push - nodef/extra-npm GitHub Wiki

Pushes changes to both Git and NPM.

  • Updates version in package.json.
  • Publishes package to NPM registry.
  • Adds all changes to repository index.
  • Creates a commit with given message.
  • Pushes package to remote Git repository.

Similar: push, clone, init.

enpm push [options] [message]
# message: commit message (version)

# Options:
# --help:   show this help
# -n, --no: no publish to npm
# -v, --version: update version (patch)
# -1, --patch:   update patch version
# -2, --minor:   update minor version
# -3, --major:   update major version
# -g, --github:  update github details
# -u, --username: github username
# -p, --password: github password

# Environment variables:
# NPM_PUSH_NO: no publish to npm (0/1)
# NPM_PUSH_VERSION: update which version (patch/minor/major/pre...)
# NPM_PUSH_PREFIX:  commit message prefix
# NPM_PUSH_MESSAGE: commit message
# NPM_PUSH_GITHUB:  update github details (0/1)
# GITHUB_USERNAME: github username
# GITHUB_PASSWORD: github password
# example package: pg
# current version: 7.0.0

# commit "v7.0.1"
$ enpm push --no

# commit "v7.0.1", publish 7.0.1
$ enpm push

# commit "patch update", publish 7.0.1
$ enpm push "patch update"

# commit "minor update", publish 7.1.0
$ export NPM_PUSH_NO=0
$ enpm push "minor update" -v minor

# commit ":+1: major update", publish 8.0.0
$ export NPM_PUSH_NO=0
$ export NPM_PUSH_PREFIX=:+1:
$ enpm push "major update" -3

References