JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 814
  • Score
    100M100P100Q94573F
  • License MIT

Intuitive version management abstraction

Package Exports

  • painless-version
  • painless-version/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (painless-version) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.