felixge/node-sandboxed-module — pull request #26 by searls (2013-10-19 19:08:25+00:00)
Title: Implements Istanbul coverage support and user-defined sourceTransformers

Three changes in this PR:

1. CoffeeScript support is abstracted into a new object called a sourceTransformer as opposed to being hard-coded with the `_getCompileInfo()` method
2. Istanbul support for code coverage is added using the same means.
3. Arbitrary user-defined source transformers may be configured with a `sourceTransformers` option passed to `SandboxedModule.require`.

I was sure to add unit tests to cover everything I did. I tried to write everything I added in a manner that was congruent with the existing code.

Suggestions:

* Right now requiring coffeescript and istanbul isn't cached between SandboxedModule.require invocations (and hadn't been previously, either. It may be significantly more performant to memoize those methods.