0.2.2 • Published 4 years ago

@hediet/semver v0.2.2

Weekly downloads
26
License
MIT
Repository
-
Last release
4 years ago

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

npm.io

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");