Skip to content

Instantly share code, notes, and snippets.

@sindresorhus sindresorhus/np.sh
Last active Nov 14, 2019

Embed
What would you like to do?
shell function for publishing node modules with some goodies
# 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
}
@sindresorhus

This comment has been minimized.

Copy link
Owner Author

sindresorhus commented Aug 16, 2015

Now available on npm: https://github.com/sindresorhus/np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.