Skip to content

Instantly share code, notes, and snippets.

@japj
Forked from creationix/custommain.js
Created July 16, 2011 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save japj/1086710 to your computer and use it in GitHub Desktop.
Save japj/1086710 to your computer and use it in GitHub Desktop.
A proposed hook into node.js to make deploying node based applications easy and not require re-compiles.
startup.customRuntimeMain = function () {
var path = NativeModule.require('path');
var custom = path.resolve(process.cwd(), process.argv[0] + ".js");
if (!path.existsSync(custom)) return;
process.argv[1] = custom;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment