New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

semantic-version-lite

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-version-lite

simple semantic version tool

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
2
Created
Source

semantic-version-lite

Sometimes we just need a tool to compute the next semantic version of packages without further operations. That's what semantic-version-lite for.

semantic-version-lite use version tag to compute next version, if version tag not found, version in package.json and the last commit changes the version is used as computation reference.

Features

  • Support stable version compute.
  • Support pre-release version compute.
  • Support version compute between pre-release and stable versions.
  • Support pre-release version sorting: alpha -> beta -> rc.
  • Support unstable version compute (v0.x.x). (NOTE: unstable version will never bump to stable, you have to update to v1.0.0 manually).

Install

npm install semantic-version-lite

Usage

import { nextVersion } from 'semantic-version-lite';

export interface VersionOptions {
  /* root dir to locate package.json */
  packageRoot?: string;
  /* pre-release type, like alpha/beta/rc */
  preRelease?: string;
  /* initial version to use if not previous version is find */
  initialVersion?: string;
  /* version bump from stable to pre-release, by default it's a major version bump */
  preReleaseBumpDigit?: VersionDigit.Major | VersionDigit.Minor;
}

nextVersion(branchToCompute, versionOptions);

Keywords

semantic

FAQs

Package last updated on 30 Jan 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