JSPM

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

Is this value a Node.js version?

Package Exports

  • is-version
  • is-version/dist/cjs/index.cjs

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 (is-version) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-version

Is this value a Node.js version?

var assert = require('assert');
var isVersion = require('is-version');

// true
assert.ok(isVersion('12.0.1'));
assert.ok(isVersion('0.0.0'));
assert.ok(isVersion('v12.0.1', 'v')); // with prefix
assert.ok(isVersion('v0.0.0', 'v')); // with prefix

// false
assert.ok(!isVersion('12'));
assert.ok(!isVersion('12.0'));
assert.ok(!isVersion('12.0.1', 'v')); // with prefix
assert.ok(!isVersion('0.0.0', 'v')); // with prefix
assert.ok(!isVersion('v12.0.1'));
assert.ok(!isVersion('v0.0.0'));
assert.ok(!isVersion('v12'));
assert.ok(!isVersion('v12.0'));
assert.ok(!isVersion('va.0.1'));
assert.ok(!isVersion('v12a.0.1'));
assert.ok(!isVersion('v12.b.1'));
assert.ok(!isVersion('v12.0b.1'));
assert.ok(!isVersion('v12.0.c'));
assert.ok(!isVersion('v12.0.1c'));