node semver range resolution. Uses nodejs.org/dist as source.
$ npm i -S semver-node
import semverNode, { resolve } from 'semver-node';
async function stable() {
let { stable } = await semverNode();
// => 5.1.1
}
async function resolve() {
let versions = await semverNode();
resolve(versions, '>=0.8.5 <=0.8.14')
// => 0.8.14
}
See the tests for more examples.
semverNode
exports a Promise by default and a resolve
convenience helper method.
Type: string
The URL to request. Defaults to https://nodejs.org/dist/
.
Resolves the specified range
. i.e. .resolve(versions, '>=0.8.5 <=0.8.14')
.
MIT © Søren Brokær