Neat! With a little bit of googling, it seems CoffeeScript can do the same thing. That lowers the barrier-to-usage of compile-to-js languages enormously!
Now I'm looking at the sweet.js source where they register the extension, and there's some additional magic I don't recognize; is module._compile documented somewhere that I just can't find, or is that getting added somewhere in the sweet.js code?
I don't think it is. I seem to recall Isaac saying that he considers require.extensions to be a mistake, though I don't know if he meant the concept (extensibility) or implementation (register hooks under filename extensions). Either way, I think it's recognized that a lot of people enjoy and use the functionality so it's unlikely to go away.
Now I'm looking at the sweet.js source where they register the extension, and there's some additional magic I don't recognize; is module._compile documented somewhere that I just can't find, or is that getting added somewhere in the sweet.js code?