To publish a package
npm publish ./
Beta version
npm publish ./ --tag beta
// to install
npm install pkname@beta
If you get error // You cannot publish over the previously published version 0.1.0
npm version {patch|minor|major} -m "commit message"
npm publish ./ --tag beta
Let's say we have a postinstall script to run after package is intalled. Might be useful to display logo or compile files.
// package.json
{
scripts: {
"6to5": babel src --out-dir lib,
"postinstall": npm run 6to5 && ./bin/displaylogo
}
}
This will fail for users whom do not install babel globally or using Windows platform. The workaround for this is
{ ...
"postinstall": npm run 6to5 && node bin/displaylogo
...}