Skip to content

Instantly share code, notes, and snippets.

@fizerkhan
Forked from coolaj86/how-to-publish-to-npm.md
Created January 25, 2013 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fizerkhan/4633387 to your computer and use it in GitHub Desktop.
Save fizerkhan/4633387 to your computer and use it in GitHub Desktop.

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

Then create a package.json and publish it:

cd /path/to/your-project
npm init

npm install -g pakmanager
# this shows you dependencies as you `require`d them
pakmanager deps
# now edit `package.json` and add any deps you forgot about

npm publish ./

More Info:

Appendix:

If you haven't already installed npm, or you'd like the latest version:

OS X

curl http://npmjs.org/install.sh | sh

Linux

curl http://npmjs.org/install.sh | sudo sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment