painless-version

3.0.0 • Public • Published

painless-version

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

Intuitive version management abstraction

Install

npm i --save painless-version

Getting Started

import { test } from 'painless-version';

const version = '5.3.5';
test(`1.2.3 < ${version}`);
// => true

Functions

test(expression: String)

Evaluate comparison string of form LHS CMP RHS where LHS and RHS are version strings and CMP is one of <, <=, >, >=, =.

Under the hood this uses compare-versions.

updateDeprecationHeaders(headers: {}, { deprecationDate: Date, sunsetDate: Date })

Modifies the headers object in place assuming this is a response headers object.

Updates headers deprecation and sunset

Existing headers are only overwritten if the date present is further in the future.

Dependencies (2)

Dev Dependencies (15)

Package Sidebar

Install

npm i painless-version

Weekly Downloads

306

Version

3.0.0

License

MIT

Unpacked Size

7.22 kB

Total Files

6

Last publish

Collaborators

  • simlu