Today I have a quick tip. Did you ever found an awesome Node module that you want or need to use from the command line but the author forgot (or didn’t have time) to create a CLI interface? That’s not a problem if you use commander.
After you install commander with
npm install commander, you just need to create a script like this:
Now you can run it from the terminal with
node my-aweseome-script.js -s or even better, create an npm module, publish it and allow the rest of the world to enjoy it.
Go and check the commander documentation and see all that you can do with it!
P.S. If you want to add colours to your terminal output, have a look at Chalk.