# find-versions

> Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`

Latest version **6.0.0** (published 2024-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install find-versions
pnpm add find-versions
yarn add find-versions
bun add find-versions
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2024-04-03 |
| First published | 2014-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | semver, version, versions, regex, regexp, match, matching, semantic, find, extract, get |

## Links

- npm: https://www.npmjs.com/package/find-versions
- Repository: https://github.com/sindresorhus/find-versions
- Homepage: https://github.com/sindresorhus/find-versions#readme
- Issues: https://github.com/sindresorhus/find-versions/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/find-versions

## Dependencies (2)

- [super-regex](https://npm.io/package/super-regex.md) ^1.0.0
- [semver-regex](https://npm.io/package/semver-regex.md) ^4.0.5

## Recent versions

- 6.0.0 (latest) — 2024-04-03
- 5.1.0 — 2022-06-09
- 5.0.0 — 2021-04-28
- 4.0.0 — 2020-12-29
- 3.2.0 — 2019-11-22
- 3.1.0 — 2019-04-15
- 3.0.0 — 2018-11-06
- 2.0.0 — 2015-11-19
- 1.2.1 — 2015-11-18
- 1.2.0 — 2015-11-14
- 1.1.3 — 2015-05-19
- 1.1.2 — 2015-02-16
- 1.1.1 — 2014-09-08
- 1.1.0 — 2014-09-07
- 1.0.0 — 2014-08-14
- … 2 more at https://npm.io/package/find-versions/versions

## README

# find-versions

> Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`

## Install

```sh
npm install find-versions
```

## Usage

```js
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

- [find-versions-cli](https://github.com/sindresorhus/find-versions-cli) - CLI for this module

---
_Source: https://npm.io/package/find-versions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
