I tried to create node module, I succeeded,
I used npm install -g at code directory, and it created this module folder in \AppData\Roaming\npm\node_modules\myfirstmodule, Now I want to make one file executable as command, like pm2. How can I do this? so I can type myfirstmodule in command prompt at any location and it will execute index.js from that module.
-
I don't have an answer but I would look at NPM and the values inside of package.json - as those are the things that called.akaphenom– akaphenom2015-06-22 13:17:47 +00:00Commented Jun 22, 2015 at 13:17
-
@akaphenom, I tried for that, but I am not getting any key will create a batch file to execute that module.Laxmikant Dange– Laxmikant Dange2015-06-22 13:19:40 +00:00Commented Jun 22, 2015 at 13:19
Add a comment
|
1 Answer
Your package.json can provide a map called bin which will make commands available. See this tutorial for more details.