NPM: How to publish your npm module

(Work in progress)

Assuming you have your project created and you are ready to publish it.

You have npm installed, a package.json, git and all those things ready.

Here’s what follows:

// Step1. Create a NPM account if you don't have one. 
// Go to npmjs.com to complete this step


// Step2. Login with you account
// Open the command line and type
$ npm login
// You will have to enter your username, email and password

// Step3. Publish the module
$ npm publish

You will receive an email to inform you that you have successfully published you package.json. From that moment on, you can install you module from npm in any project.

 

All you have to do is

npm install your_module_name

your_module_name is actually the value of your “name” property at your package.json

 

All done.

Hope it helps.

 

Leave a Reply

Close Menu