# pkg-versions

> Get the version numbers of a package from the npm registry

Latest version **4.0.0** (published 2024-02-26) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2024-02-26 |
| First published | 2016-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | versions, version, numbers, npm, registry, package, package.json, json, module |

## Links

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

## Dependencies (1)

- [package-json](https://npm.io/package/package-json.md) ^10.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 4.0.0 (latest) — 2024-02-26
- 3.0.0 — 2022-06-06
- 2.1.0 — 2019-04-05
- 2.0.0 — 2019-03-12
- 1.1.0 — 2017-03-26
- 1.0.0 — 2017-01-13
- 0.2.1 — 2016-12-21
- 0.2.0 — 2016-06-17

## README

# pkg-versions

> Get the version numbers of a package from the npm registry

## Install

```sh
npm install pkg-versions
```

## Usage

```js
import packageVersions from 'pkg-versions';

console.log(await packageVersions('ava'));
//=> {'0.0.3', '0.0.4', …}
```

## API

### packageVersions(packageName)

Returns a `Promise<Set<string>>` with the versions.

#### packageName

Type: `string`

The name of the package to look up versions for.

## Related

- [package-json](https://github.com/sindresorhus/package-json) - Get the package.json of a package from the npm registry
- [latest-version](https://github.com/sindresorhus/latest-version) - Get the latest version of an npm package
- [npm-keyword](https://github.com/sindresorhus/npm-keyword) - Get a list of npm packages with a certain keyword
- [npm-user](https://github.com/sindresorhus/npm-user) - Get user info of an npm user
- [npm-email](https://github.com/sindresorhus/npm-email) - Get the email of an npm user

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