painless-version
Intuitive version management abstraction
Install
npm i --save painless-version
Getting Started
const pv = require('painless-version');
const version = '5.3.5';
pv.test(`1.2.3 < ${version}`);
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.
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.
The onSunsetCb
is called if the computed sunset day has passed.