How to write command line programs in Node.js

Ever wondered how to create command line Node.js scripts? If not, go through Node's in-built modules like Child Process, File System, Readline, and Process and see if they inspire you in any way. If not, you can skip this post. Else, this post will take you to the next level of Node Fu.

We will write a command line utility called nodels, which will work something like the Linux ls command with the -la option.

Wooohooo! There you have it - your own command, your own system utility written in Node.js.

Though you have created a command line utility using Node.js, it is confined only to your system. Want to create a global Node module that everyone can install using NPM? Read this post on creating NPM packages.