Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node Meetup Malmö, March 2014

Node Meetup Malmö, March 2014

Quick presentation on some good things to know about if one want to publish a package on npm

Pelle Wessman

March 04, 2014
Tweet

More Decks by Pelle Wessman

Other Decks in Programming

Transcript

  1. Required fields • name – should be URL-safe! (and no

    ”js”, ”node”) • version – semantic please! http://semver.org/
 1.0.0 === Major.Minor.Patch version
  2. Info fields • description • repository • homepage • bugs

    • author • (README.md – and please – a changelog somewhere!) • (http://npmjs.org/~ – your social media and geek media (IRC) links!)
  3. Code fields • main – the one field that node.js

    itself uses • directories – directories.lib / directories.example
  4. Global module fields • preferGlobal – results in warning on

    local install • bin / directories.bin • man / directories.man
  5. .npmignore Defaults to .gitignore + eg. .DS_Store, .git, npm-debug.log Good

    for excluding tests, examples etc. from packages
  6. • npm deprecate – package or version range • npm

    version <major,minor,patch,1.33.7>
  7. npm link to use your module locally during development (…but

    exclude the global npm folder from OS X Time Machine)