Friday 12 August 2016

Post 61: How to publish npm packaage


create a project for that package if you haven't done so

push it to git hub
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/yourUsername/nodebb-plugin-your-project.git
git push -u origin master

create an a user account on npm if this is your first time:
npm adduser

Type in your username, password, and e-mail (e-mail will be public). Store your crendentials on your local machine:
npm login

To ensure that your credentials or stored on the client type in:
npm config ls

To ensure that your acccount was created successfully go to the following URL and you should see your account:
https://npmjs.com/~/[your-username]

cd to the folder of the module or plugin you want to publish on npm . and type in:
npm publish

Note that everything in the directory will be included unless it is ignored by a local.gitignore or .npmignore file as described in npm-developers.

To ensure that your package is publish go to 
https://npmjs.com/package/[your-package-name]


No comments:

Post a Comment

Tweet