First, do whatever bundling you need to do, example:
npm run build-stuff
Log into NPM:
npm login
Check what will be uploaded. Ensure nothing sensitive is included.
npm publish --dry-run
Publish the package:
npm publish
Note: you can add --access=public
for scoped libs.
To auto patch the version:
npm version patch
npm publish
Alternatively:
npm unpublish <packagname>@x.x.x-readme // The specific version readme that you want to update
npm publish
Further reading: