Socket
Socket
Sign inDemoInstall

bump-file

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bump-file

Bump JSON files (e.g. package.json and friends)


Version published
Weekly downloads
4.2K
decreased by-9.81%
Maintainers
1
Install size
67.8 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 07 Jan 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc