I use child_process.spawn to create a new process:
child_process.spawn('node', ['app.js', 'x']);
is there a way for me to get the cmd args(['app.js', 'x']
) in app.js?
You should be able to access this in the usual way (the global process API) by accessing process.argv
or process.execArgv
within app.js