https://github.com/webpro/bump-file
Bump JSON files (e.g. package.json and friends)
https://github.com/webpro/bump-file
Last synced: 7 months ago
JSON representation
Bump JSON files (e.g. package.json and friends)
- Host: GitHub
- URL: https://github.com/webpro/bump-file
- Owner: webpro
- License: mit
- Created: 2017-10-08T14:37:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-24T06:02:17.000Z (over 6 years ago)
- Last Synced: 2025-09-21T11:55:22.652Z (7 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bump-file
## Installation
```
npm install bump-file
```
## 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 bump-file`), 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.