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

semver-utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semver-utils

Tools for manipulating semver strings and objects

  • 1.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is semver-utils?

The semver-utils npm package provides utilities for parsing, comparing, and manipulating semantic version strings. It is useful for developers who need to handle versioning in their applications, ensuring compatibility and proper version management.

What are semver-utils's main functionalities?

Parsing Semantic Versions

This feature allows you to parse a semantic version string into its component parts, such as major, minor, patch, and pre-release identifiers.

const semverUtils = require('semver-utils');
const parsed = semverUtils.parse('1.2.3-alpha.1');
console.log(parsed);

Comparing Versions

This feature enables you to compare two semantic version strings to determine their order. It returns -1, 0, or 1 depending on whether the first version is less than, equal to, or greater than the second version.

const semverUtils = require('semver-utils');
const result = semverUtils.compare('1.2.3', '1.2.4');
console.log(result);

Incrementing Versions

This feature allows you to increment a semantic version string by a specified part (major, minor, or patch).

const semverUtils = require('semver-utils');
const incremented = semverUtils.increment('1.2.3', 'patch');
console.log(incremented);

Other packages similar to semver-utils

Keywords

FAQs

Package last updated on 09 Oct 2018

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