bump-file
Bump JSON files (e.g. package.json and friends)
Last updated 7 years ago by webpro .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install bump-file 
SYNC missed versions from official npm registry.

file-bump

Installation

npm install file-bump

Usage

Node.js

import bump from 'bump-file';

bump(file, [increment='patch']);

The second argument can also be an object:

bump(file, {
  increment,
  preId,        // Prerelease identifier (such as "alpha", "beta", "rc")
  get,          // Function to get version. Default: pkg => pkg.version
  set           // Function to set version. Default: (pkg, version) => pkg.version = version
});

CLI

You can install this globally (npm install -g file-bump), and use from CLI:

bump file [increment] [preId]

Examples

bump('package.json', 'minor'); // 1.0.0 → 1.1.0

bump('package.json', {         // 1.4.2 → 2.0.0-beta.0
  increment: 'premajor',
  preId: 'beta'
});

See the tests for more example.

Current Tags

  • 2.0.0                                ...           latest (6 years ago)

2 Versions

  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE