Using yarn and npm for publishing npm packages.Aug 04, 2019 · 1 min
Setting up the pre-release version for npm package.
If you already have a package in NPM registry and need a per-release to test minor or major updates among fellow
tester then npm has
next tag to achieve this.
Here are those simple steps:
package.jsonfile to set a pre-release version. With yarn you can run
yarn versionto update version info in package.json file. Pre-release version e.g:
npm publish yourpackage.tgz --tag nextto publish the package under the next tag. For yarn:
yarn publish yourpackage.tgz --tag next
npm install --save [email protected]to install prerelease package
Unpublish specific version for NPM registry
To add JSDelivr to distribute package from CDN add following lines in
Also, it is important to update index.js file location.
Use Library to automate publishing task.
A package call
np can automate a lot of publishing task & has other helpful feature.
Here are simple steps:
npm install --global np to install it globally.
np on project directory. It will show interactive UI steps to perform publish.