Become a node package maintainer

Become a node package maintainer

Node's official package manager npm already has more then 17.000 entries.

These packages enable node developers to build web applications faster than ever. It's time to give something back to this great community and to contribute your own package.

Damien Klinnert will show how to become a node package maintainer with a detailed introduction and a best practices talk.

9809d0f32f9e4e3f4b14ce26400c0866?s=128

damienklinnert

November 23, 2012
Tweet

Transcript

  1. become a node package maintainer opinionated guide about creating and

    maintaining Donnerstag, 22. November 12
  2. intro Donnerstag, 22. November 12

  3. whois damienklinnert.com • javascript developer && computer science student &&

    working at doctape • follow me @damienklinnert Donnerstag, 22. November 12
  4. summary one: create • npm commands, package.json, folder structure, documentation,

    testing, style, build tools, git(-hub), publish two: maintain • evolution / revolution, update, semantic versioning, appreciate help Donnerstag, 22. November 12
  5. y u speak? • node and npm are awesome •

    everyone can publish packages w/o control • lots of crappy packages (crappy maintenance, crappy docs, crappy code, crappy style, crappy structure, …) Donnerstag, 22. November 12
  6. one: create Donnerstag, 22. November 12

  7. npm commands • npm init • npm install • npm

    run-script • npm docs • npm test • npm pack • npm adduser • npm publish Donnerstag, 22. November 12
  8. package.json create skeleton with $ npm init Donnerstag, 22. November

    12
  9. folder structure Donnerstag, 22. November 12

  10. documentation • minimum: README.md and LICENSE • better: docs/, HISTORY.md,

    config.example • use comments, jsdoc and UML •easy to install, use and contribute Donnerstag, 22. November 12
  11. testing • use all: unit tests, functional tests, integration tests

    • add working examples in examples/ • travis-ci • utilize $ npm test Donnerstag, 22. November 12
  12. style • lint your code (use a lintconfig and ship

    it) • use only one coding style and keep a reference to it • make it simple + understandable Donnerstag, 22. November 12
  13. build tool GRUNT.JS simple tasks: npm, complex task: grunt.js Donnerstag,

    22. November 12
  14. git(-hub) • .npmignore / .gitignore • specify repo and bugtracker

    url in package.json • keep versions the same with git tags • create HISTORY.md from git log Donnerstag, 22. November 12
  15. publish • as easy as $ npm adduser && npm

    publish • will read your package.json Donnerstag, 22. November 12
  16. two: maintain Donnerstag, 22. November 12

  17. evolution / revolution • check whether there already is a

    similar package and contribute instead • stick to your own design, style and guides Donnerstag, 22. November 12
  18. update • update often • fix bugs ASAP • never

    ever unpublish (be aware of dependencies) • keep repo and npm packages at the same state Donnerstag, 22. November 12
  19. semantic versioning MAJOR.MINOR.PATCH 0.1.0, 0.2.3, 2.3.15 Major: API changes Minor:

    new functionality Patch: bugfixes http://semver.org/ Donnerstag, 22. November 12
  20. appreciate help • name contributors • react immediately • enable

    discussions • merge pull requests Donnerstag, 22. November 12
  21. thank you who writes a tool to automate this? Donnerstag,

    22. November 12