Back to blog

Basic New NPM Version Workflow

I currently have one published NPM package: the S3 Bulk Redirector. It’s a very simple package for a very specific use case. I only update it when the dependent packages need updating, which is not that often. I recently had to this and, in that process, I realized I didn’t have a coherent workflow for releasing a new NPM version. I had to review terminal command history to see what I did and then replicated it all.

To make sure I never had to do that again, I wrote down the general steps I take to release a new NPM version for the S3 Bulk Redirector package. Below are those basic steps:

  1. Update the version number in the script and add it to the changelog (with appropriate comments). Commit the change to main.
  2. Use npm version to bump the version number appropriately.
  3. git push origin main && git push --tags - Push up the changes to GitHub.
  4. Run npm publish --dry-run and confirm that everything looks correct in the package contents.
  5. npm publish

And it’s published! After that’s done, I make a release in GitHub using the tag the npm version command created so the new version shows on the GitHub sidebar.

And that’s it.

With the new version fully published, it can thus be downloaded and used in projects. I have a few personal projects that use the package, so after releasing a new version I immediately go and update them. Once updated, I test out the bulk redirection. It’s a smoke test of sorts to make sure it truly works in the wild.

All in all, this is pretty simple workflow, but there are multiple steps to it that shouldn’t be forgotten. It’s a small package, but I want everything to be accurate and up to date which means remembering to do all of this each time I upgrade it.

Read more on similar topics