find-versions
Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`
Last updated 6 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install find-versions 
SYNC missed versions from official npm registry.

find-versions Build Status

Find semver versions in a string: unicorn v1.2.31.2.3

Install

$ npm install find-versions

Usage

const findVersions = require('find-versions');

findVersions('unicorn v1.2.3 rainbow 2.3.4+build.1');
//=> ['1.2.3', '2.3.4+build.1']

findVersions('cp (GNU coreutils) 8.22', {loose: true});
//=> ['8.22.0']

API

findVersions(stringWithVersions, [options])

stringWithVersions

Type: string

options

Type: Object

loose

Type: boolean Default: false

Also match non-semver versions like 1.88. They're coerced into semver compliant versions.

Related

License

MIT © Sindre Sorhus

Current Tags

  • 3.2.0                                ...           latest (6 months ago)

13 Versions

  • 3.2.0                                ...           6 months ago
  • 3.1.0                                ...           a year ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           5 years ago
  • 1.2.1                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago

Copyright 2014 - 2017 © taobao.org |