Skip to content

Instantly share code, notes, and snippets.

@ProfAvery
Created February 12, 2014 07:13
Show Gist options
  • Save ProfAvery/8951231 to your computer and use it in GitHub Desktop.
Save ProfAvery/8951231 to your computer and use it in GitHub Desktop.
Shim for running simple Node.js modules with jrunscript
(function(global) {
if (typeof java !== "undefined") {
this.console = { log: function(s) { println(s); } }
// Download from https://raw.github.com/micmath/Rhino-Require/master/src/require.js
load("require.js");
}
}(this));
// Call console.log() and require() as usual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment