# latest-version2

> Get the latest version of an npm package

Latest version **1.0.4** (published 2019-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install latest-version2
pnpm add latest-version2
yarn add latest-version2
bun add latest-version2
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-09-10 |
| First published | 2019-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 177 |
| Author | huruji |
| Maintainers | huruji |
| Keywords | latest, version, npm, pkg, package, package.json, current, module |

## Links

- npm: https://www.npmjs.com/package/latest-version2
- Repository: https://github.com/sindresorhus/latest-version
- Homepage: https://github.com/sindresorhus/latest-version#readme
- Issues: https://github.com/sindresorhus/latest-version/issues
- npm.io page: https://npm.io/package/latest-version2

## Dependencies (3)

- [rc](https://npm.io/package/rc.md) ^1.2.8
- [got](https://npm.io/package/got.md) ^9.6.0
- [package-json](https://npm.io/package/package-json.md) ^6.3.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

- 1.0.4 (latest) — 2019-09-10
- 1.0.3 — 2019-09-10
- 1.0.2 — 2019-09-10
- 1.0.1 — 2019-09-10
- 1.0.0 — 2019-09-10

## README

# latest-version [![Build Status](https://travis-ci.org/sindresorhus/latest-version.svg?branch=master)](https://travis-ci.org/sindresorhus/latest-version)

> Get the latest version of an npm package

Fetches the version directly from the registry instead of depending on the massive [npm](https://github.com/npm/npm/blob/8b5e7b6ae5b4cd2d7d62eaf93b1428638b387072/package.json#L37-L85) module like the [latest](https://github.com/bahamas10/node-latest) module does.


## Install

```
$ npm install latest-version
```


## Usage

```js
const latestVersion = require('latest-version');

(async () => {
	console.log(await latestVersion('ava'));
	//=> '0.18.0'

	console.log(await latestVersion('@sindresorhus/df'));
	//=> '1.0.1'

	// Also works with semver ranges and dist-tags
	console.log(await latestVersion('npm', {version: 'latest-5'}));
	//=> '5.5.1'
})();
```


## Related

- [latest-version-cli](https://github.com/sindresorhus/latest-version-cli) - CLI for this module
- [package-json](https://github.com/sindresorhus/package-json) - Get the package.json of a package from the npm registry


---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-latest-version?utm_source=npm-latest-version&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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