Skip to content

Instantly share code, notes, and snippets.

@pieterbeulque
Created January 20, 2016 13:55
Show Gist options
  • Save pieterbeulque/a0a6169c2318178f1fdd to your computer and use it in GitHub Desktop.
Save pieterbeulque/a0a6169c2318178f1fdd to your computer and use it in GitHub Desktop.
Publishing JS packages on NPM

Publishing JS packages on NPM

Make sure you have an NPM & Travis account.

NPM

  • npm init
  • update package.json (ref)
  • commit & push
  • npm publish

Travis

  • gem install travis
  • travis init
  • travis setup npm
  • commit & push

Collaborator

npm owner add pieterbeulque

npm owner add yvesvanbroekhoven

npm owner add fd

@yvesvanbroekhoven
Copy link

Get NPM API key:

$ cat ~/.npmrc

The value behind authToken:

...
//registry.npmjs.org/:_authToken=xxx
...

@yvesvanbroekhoven
Copy link

Publish a new version

  • Add & commit your changes
  • Bump version number:
    • npm version patch
    • npm version minor
    • npm version major
  • git push --tags

Check Travis to see if your build is correct. If so, Travis will publish your update to NPM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment