Skip to content

Instantly share code, notes, and snippets.

@aricart
Last active January 10, 2020 21:40
Show Gist options
  • Save aricart/6ca033e0faec6cf0bbebc5b1ed9029e7 to your computer and use it in GitHub Desktop.
Save aricart/6ca033e0faec6cf0bbebc5b1ed9029e7 to your computer and use it in GitHub Desktop.
npm release workflow
> npm dist-tag
latest: 1.3.0
next: 1.3.0
// start on feature - create a branch, edit code commit

// Time to release the 'pre release'
> npm version premajor
v2.0.0–0

> npm publish --tag=next
npm notice
npm notice 📦 mypackage@2.0.0–0
…
// yay package is available with npm install mypackage@next

// fix bugs, change code, commit
> npm version prerelease
v2.0.0–1

// release another pre release
> npm publish --tag=next
npm notice
npm notice 📦 mypackage@2.0.0–1
…
// repeat dev cycle until the release is stable

// Once finished, time to release it as a 2.0.0
> npm version major
v2.0.0
// The prerelease qualifier was removed
> npm publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment