# npm-push

[![NPM](https://nodei.co/npm/npm-push.png)](https://nodei.co/npm/npm-push/)

Push and Publish changes with bumped version to both Git and NPM.
> **NOTE:** [npm-push] is now updated to [@extra-npm/push].

```bash
# npm-push [flags] [<message>]
# [-p|--publish]: publish to npm
# [-0|--check]: don't update version
# [-1|--patch]: update patch version (default)
# [-2|--minor]: update minor version
# [-3|--major]: update major version
# [-r|--repository]: update repository url from git config
# [--help]: show this help
# [<message>]: commit message (default = package version)
# [[optional environment variables]]
# NPM_PUSH_PUBLISH: publish to npm (0/1)
# NPM_PUSH_VERSION: update which version (check/patch/minor/major)
# NPM_PUSH_REPOSITORY: update repository url from git config (0/1)
# NPM_PUSH_PREFIX: commit message prefix
# NPM_PUSH_MESSAGE: commit message
```
```bash
# example package: pg
# current version: 7.0.0

# commit "v7.0.1"
npm-push

# commit "v7.0.1", publish 7.0.1
npm-push --publish

# commit "check update"
npm-push "check update" --check

# commit "patch update", publish 7.0.1
npm-push -p "patch update"

# commit "minor update", publish 7.1.0
NPM_PUSH_PUBLISH=1
npm-push "minor update" --minor

# commit ":+1: major update", update repository, publish 8.0.0
NPM_PUSH_PUBLISH=1
NPM_PUSH_PREFIX=:+1:
npm-push "major update" -3 --repository
```


[npm-push]: https://www.npmjs.com/package/npm-push
[@extra-npm/push]: https://www.npmjs.com/package/@extra-npm/push
