[DRAFT] JavaScript Node.js Scripts

Node.js Scripts

Difference between a node module and a npm package: npm package might be not a single node module but it can consists of many node modules.

How to create a npm package and publish it to NPM

Short instruction to create a new npm package

First login to NPM using npm adduser or npm login command source. Now go to a new project folder and run npm init and create an index.js file with exports object. Then run npm publish, now you can install your package in another project. You can also use npm link to link your package globally.

Release a new version of a npm package

Simply use command npm version <update_type> where <update_type> is one of the semantic versioning release types, patch, minor, or major source.

Node Scripts

Shebang line:

#! /usr/bin/env node

How to build a command line tool with shelljs


How to build CLI with commander