Skip to content

Instantly share code, notes, and snippets.

@spollack
Created January 8, 2014 22:38
Show Gist options
  • Save spollack/8325810 to your computer and use it in GitHub Desktop.
Save spollack/8325810 to your computer and use it in GitHub Desktop.
A thunk to load a single streamline source file (passed as a command line parameter) from vanilla node. Useful for one-offs. A similar approach can be taken to run mocha tests that include streamline code. The use of the optimist package here is pure sugar, and could be skipped if desired. In a typical full app, the main file would do the stream…
require('streamline').register({
fibers: true,
cache: true,
verbose: true
});
var argv = require('optimist')
.usage('Usage: $0 -r streamlineFilePath')
.demand(['r'])
.argv;
require(argv.r);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment