Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanem/npmrel
:squirrel: Release NPM modules from the command-line.
https://github.com/tanem/npmrel
Last synced: 8 days ago
JSON representation
:squirrel: Release NPM modules from the command-line.
- Host: GitHub
- URL: https://github.com/tanem/npmrel
- Owner: tanem
- License: mit
- Created: 2014-10-05T04:14:24.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-30T19:55:52.000Z (over 5 years ago)
- Last Synced: 2024-10-29T13:55:44.644Z (14 days ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# npmrel
[![npm version](https://img.shields.io/npm/v/npmrel.svg?style=flat-square)](https://www.npmjs.com/package/npmrel)
[![npm downloads](https://img.shields.io/npm/dm/npmrel.svg?style=flat-square)](https://www.npmjs.com/package/npmrel)
[![dependency status](https://david-dm.org/tanem/npmrel.svg?style=flat-square)](https://david-dm.org/tanem/npmrel)Release [NPM](https://www.npmjs.org/) modules.
```
Usage: npmrel [ | major | minor | patch | premajor | preminor | prepatch | prerelease] [options]Options:
-h, --help output usage information
-V, --version output the version number
-m, --message [msg] The commit message to use.
If unspecified, will default to "Release vx.x.x".
```## installation
```
$ npm install -g npmrel
```## implementation
* Bumps the `package.json` version
* Commits all changes with a custom or default message ("Release vx.x.x")
* Tags the commit as "vx.x.x"
* Pushes the commit
* Pushes the tag
* Publishes to NPM## usage
### cli
```
$ cat package.json | grep version
"version": "1.0.0",
$ npmrel major -m "This is release v%s"
$ git log -1 --format="%s"
This is release v2.0.0
$ npmrel patch
$ git log -1 --format="%s"
Release v2.0.1
$ npmrel v2.1.0 -m "Releasing version %s"
$ git log -1 --format="%s"
Releasing version 2.1.0
```### api
#### npmrel(newVersion, [commitMessage])
__Arguments__
* `newVersion` - The new version or release type to move to.
* `commitMessage` - *Optional* The git commit message to use. If omitted, defaults to `Release v%s` where `%s` is the incremented version.__Examples__
```js
const npmrel = require('npmrel');// These are api versions of the cli examples above.
npmrel('major', 'This is release v%s');
npmrel('patch');
npmrel('v2.1.0', 'Releasing version %s');
```## license
MIT