Checklist for Publishing NPM Packages
Checklists can be useful tools to handle the complexities of modern life. Used by pilots and other professions handling complex tasks, checklists can also be useful for software developers. Read more in this article about a quality checklist for publishing NPM packages.
Many professions need to handle today more complex and more specialized tasks than ever. As author Atul Gawande argues in his book "The Checklist Manifesto" (2010, Picador, New York), checklists can be a valuable tool to tackle complexity in a variety of tasks. They enable software developers to repeatably handle complex tasks like releasing an NPM package.
Using checklists, the software developer can be sure she misses no critical element of releasing an NPM package. This will lead to more quality and higher reliability. Another effect is that checklists enable team members to better communicate and solve problems faster.
This is why I want to present my version of the checklist for releasing packages on NPM.
- Is your documentation up-to-date? Do you have at least a
- Have you added the release notes?
- Do you have all necessary fields filled out in the
- Have you filled out the
author(including author webpage url) fields?
- Is the
licensefield filled out?
- If you have a website, is the
homepagefield filled in?
- Do you use a bug tracker? If so, is the
bugsurl field entered?
- Semantic versioning (semver) is recommended. Do you adhere to it and have you updated the
versionfield in the
- Have you added unit and/or E2E tests?
- Are the tests automatically executed in your CI pipeline?
- Have you tested your package as it is used by another developer? Try the
npm linkcommands. Alternatively, try the workspaces feature of NPM or yarn.
- Have you implemented security checks? At least run
- Have you checked the OWASP Top 10?
- Have you created a git tag according to semver?
Publish to GitHub
- Have you published all your updated code on GitHub?
Publish to NPM
- Have you created an NPM account to upload your package?
When everything is done and the tests are fine, you can publish your NPM package with:
There exists a tool called
np that automatically does some sanity checks. It can be
used instead of
npm publish and complements this list.
I hope with this checklist I could help you as a software developer to quality control your NPM release process. It is not rocket science and easy to extend and adapt. Thus, I want to encourage you to adapt the checklist to your needs.
Npm publish: https://docs.npmjs.com/cli/v8/commands/npm-publish
Article best practices publishing NPM package by Snyk: https://snyk.io/blog/best-practices-create-modern-npm-package/
Cover photo by Markus Winkler on Unsplash
This work is licensed under a Creative Commons Attribution 4.0 International License.