1.0.3 • Published 8 years ago

test-version v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

test-version

NPM version build status

Test if a given version matches a version pattern

Install

$ npm install test-version

Usage

const test = require('test-version');

if (test('v1.0.0', '>=1.0.0')) {
    console.log('matched!');
}
else {
    console.log('not matched');
}

Patterns

version can be like:

1.0.0 => 1.0.0
1-0-0 => 1.0.0
v1.0  => 1.0

version pattern can be like:

1.0.0
1.0.x
1.0.*
!1.0.0
~1.0.0
^1.0.0
>1.0.0
<1.0.0
1.0.0...1.9.9
1.0.0~1.9.9
1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago