javascript - how to execute a command line in node.js? -


i using actionhero framework, can started command actionhero start. problem that, cloud node.js app runner can run app specify main file, such index.js. how can adapt app started normal node.js file?

you have 2 choices

choice #1 can use child_process execute shell node.js application. see how can invoke ruby node.js? reference. method native node.js way. don't need install external npm.

choice #2 use shelljs execute such command. (https://github.com/arturadib/shelljs) way allows execute command quite similar using child_process makes code little neater.


Comments