Publish Your Node Module to NPM


You have a node module and want in on npm registry for others to use by simply running:

npm install <your_module_name>


  1. Install nodejs
  2. At least the following 3 files:
    • package.json (run npm init to create one and follow the prompts)
    • < module >.js
    • < module-test >.js (optional but recommended. mocha or jasmine is good)


1) Register yourself on npm or login
You can do this via the npmjs site or running

npm add-user

and providing a username & email.

2) Publish your node module to npm

npm publish <your_module_name>

Bam! You’re done.
Note: It will fail if the node module name is already taken.

Other housekeeping

Update your published node module

Increment the version number in your package.json. Run

npm publish 

Your node module is now updated!

Uninstall node module

npm uninstall <module_name>


My mini stats node module: