# get-versions

> Get the Node.js versions supported by your package

Latest version **1.2.7** (published 2019-03-01) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

Provides the command `get-versions`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.7 |
| Published | 2019-03-01 |
| First published | 2018-12-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.10.0 |
| Dependencies | 8 |
| Unpacked size | 49 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ehmicky |
| Maintainers | ehmicky |
| Keywords | nodejs, node-js, node, version, versions, semver, semver-range, semantic-versioning, releases, node-release |

## Links

- npm: https://www.npmjs.com/package/get-versions
- Repository: https://github.com/ehmicky/get-versions
- Homepage: https://git.io/fp7d2
- Issues: https://github.com/ehmicky/get-versions/issues
- npm.io page: https://npm.io/package/get-versions

## Dependencies (8)

- [moize](https://npm.io/package/moize.md) ^5.4.2
- [yargs](https://npm.io/package/yargs.md) ^13.2.1
- [semver](https://npm.io/package/semver.md) ^5.6.0
- [core-js](https://npm.io/package/core-js.md) ^2.6.5
- [pkg-dir](https://npm.io/package/pkg-dir.md) ^3.0.0
- [jest-validate](https://npm.io/package/jest-validate.md) ^24.0.0
- [node-releases](https://npm.io/package/node-releases.md) ^1.1.8
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.3.4

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.2.7 (latest) — 2019-03-01
- 1.2.6 — 2019-03-01
- 1.2.4 — 2019-02-08
- 1.2.3 — 2019-02-08
- 1.1.0 — 2018-12-31
- 1.0.1 — 2018-12-12
- 1.0.0 — 2018-12-12
- 0.1.0 — 2018-12-12
- 0.0.3 — 2018-12-11

## README

[![downloads](https://img.shields.io/npm/dt/get-versions.svg?logo=npm)](https://www.npmjs.com/package/get-versions) [![last commit](https://img.shields.io/github/last-commit/ehmicky/get-versions.svg?logo=github&logoColor=white)](https://github.com/ehmicky/get-versions/graphs/contributors) [![Coverage Status](https://img.shields.io/codecov/c/github/ehmicky/get-versions.svg?label=test%20coverage&logo=codecov)](https://codecov.io/gh/ehmicky/get-versions) [![travis](https://img.shields.io/travis/ehmicky/get-versions/master.svg?logo=travis)](https://travis-ci.org/ehmicky/get-versions/builds) [![node](https://img.shields.io/node/v/get-versions.svg?logo=node.js)](#) [![Gitter](https://img.shields.io/gitter/room/ehmicky/get-versions.svg?logo=gitter)](https://gitter.im/ehmicky/get-versions)

Get the Node.js versions supported by your package.

This can be used when you want to perform an action on each Node.js version
supported by your package, such as testing or using Babel.

# Installation

```bash
$ npm install get-versions
```

# Usage

```js
const getVersions = require('get-versions')

const versions = getVersions(options)
```

`versions` is an array like:

```json
["6.0.0", "8.15.0", "10.15.1", "11.10.0"]
```

The Node.js versions supported by your package are guessed from the
[`engines.node`](https://docs.npmjs.com/files/package.json#engines) field in
your `package.json`.

Only the last release of each major Node.js version is returned. Exception:
for the oldest major Node.js version, the first matching release is returned
instead. This is done in order to cover the full versions range.

# Usage (CLI)

```bash
$ get-versions >=6
6.0.0
8.15.0
10.15.1
11.10.0
```

or with options:

```bash
$ get-versions --lts
6.0.0
8.15.0
10.15.1
```

# Options

`options` is an object with the following properties.

## `range` `{string}`

Semver range used as main input. Defaults to the [`engines.node`](https://docs.npmjs.com/files/package.json#engines) field in
your `package.json`. It has the same syntax as that field,
e.g. `>=6.5.0` or `6 - 8`.

## `deprecated` `{boolean}`

If `false` (the default value), skip the versions
[not maintained by Node anymore](https://github.com/nodejs/Release), i.e.
either old, or neither LTS nor current.

## `lts` `{boolean}`

If `true` (default: `false`), only include
[LTS versions](https://github.com/nodejs/Release#lts-staging-branches).

## `cwd` `{string}`

Change the current directory, which is used to find your `package.json`.

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