Skip to content

Instantly share code, notes, and snippets.

@michaelficarra
Created December 18, 2010 17:56
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 michaelficarra/746710 to your computer and use it in GitHub Desktop.
Save michaelficarra/746710 to your computer and use it in GitHub Desktop.
forkNode
forkNode = ->
args = process.argv[1..]
nodeArgs = []
while (idx = args.indexOf '--nodejs') > -1
nodeArgs = nodeArgs.concat args.splice(idx,2)[1].split(/\s+/)
spawn process.execPath, nodeArgs.concat(args),
cwd: process.cwd()
env: process.env
customFds: [0, 1, 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment