find-versions
Find semver versions in a string: `unicorn 1.0.0` → `1.0.0`
Last updated 9 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install find-versions 
SYNC missed versions from official npm registry.

find-versions

Find semver versions in a string: unicorn v1.2.31.2.3

Install

npm install find-versions

Usage

import findVersions from '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

Current Tags

  • 6.0.0                                ...           latest (9 months ago)

17 Versions

  • 6.0.0                                ...           9 months ago
  • 5.1.0                                ...           3 years ago
  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.2.0                                ...           5 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           9 years ago
  • 1.2.1                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.3                                ...           10 years ago
  • 1.1.2                                ...           10 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (4)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE