You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@hediet/semver

Package Overview
Dependencies
5
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hediet/semver

A typed implementation of the Semantic Version 2.0.0 specification.


Version published
Weekly downloads
594
decreased by-1.98%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@hediet/semver - TypeScript Implementation of The Semantic Version Specification

A sane TypeScript implementation of the Semantic Version specification 2.0.0. Some features are still missing but will be implemented eventually.

Install

To install the library:

yarn add @hediet/semver

Features

  • Parse/Stringify versions
  • Modify/Increment versions
  • Versions are immutable

Examples

const ver = SemanticVersion.parse("1.0.0-alpha.1");
equal(ver.major, 1);

const ver1 = ver.with({ prerelease: null });
equal(ver1.toString(), "1.0.0");

const ver2 = ver.with({ patch: "increment" });
equal(ver2.toString(), "1.0.1-alpha.1");

const ver3 = ver.with({ patch: "increment", prerelease: null });
equal(ver3.toString(), "1.0.1");

FAQs

Package last updated on 04 Jul 2021

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc