Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bump-version-range

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bump-version-range

Produces a new semver version range while keeping the existing format.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

bump-version-range

Build Status npm

Given an existing semver version range and a fixed version number, produces an updated version range matching the existing range format.

npm install bump-version-range --save

Examples

import bumpRange from 'bump-version-range';

bumpRange({ oldRange: '^0.x', newVersion: '1.2.3' });
// '^1.x'

bumpRange({ oldRange: '<=9.12.x', newVersion: '15.0.2' });
// '<=15.0.x'

bumpRange({ oldRange: 'not-a-valid-range', newVersion: '1.2.3' });
// '1.2.3'

Supported range formats

See test/index.js for the tested ranges. In summary:

  • Modifiers: ^, ~, <, <=, >=, >
  • Version formats: 0.0.0, 0.0.x, 0.x.x, 0.x

FAQs

Package last updated on 25 Aug 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc