Last active
December 11, 2022 21:26
-
-
Save sindresorhus/8435329 to your computer and use it in GitHub Desktop.
shell function for publishing node modules with some goodies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# npm publish with goodies | |
# prerequisite: `npm install -g trash` | |
# `np` with an optional argument `patch`/`minor`/`major`/`<version>` | |
# defaults to `patch` | |
np() { | |
trash node_modules &>/dev/null; | |
git pull --rebase && | |
npm install && | |
npm test && | |
npm version ${1:-patch} && | |
npm publish && | |
git push --follow-tags | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now available on npm: https://github.com/sindresorhus/np