find-versions
Find semver versions in a string: `unicorn 1.0.0` → `1.0.0`
Last updated 10 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm
$ 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

  • 5.0.0                                ...           latest (4 years ago)

5 Versions

  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           5 years ago
  • 1.2.1                                ...           10 years ago
  • 3.1.0                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org