latest-version

Get the latest version of an npm package

MIT 16 个版本
安装
npm install latest-version
yarn add latest-version
pnpm add latest-version
bun add latest-version
README

latest-version

Get the latest version of an npm package

Fetches the version directly from the registry instead of depending on the massive npm module like the latest module does.

Install

npm install latest-version

Usage

import latestVersion from 'latest-version';

console.log(await latestVersion('ava'));
//=> '6.1.1'

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

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

This package exposes the version, registryUrl, and omitDeprecated options from package-json, as well as the PackageNotFoundError and VersionNotFoundError errors.

版本列表
9.0.0 2024-02-27
8.0.0 2024-01-23
7.0.0 2022-06-23
6.0.0 2021-07-22
5.1.0 2019-04-04
5.0.0 2019-03-12
4.0.0 2018-06-09
3.1.0 2017-03-26
3.0.0 2017-02-13
2.0.0 2015-10-09
1.0.1 2015-06-18
1.0.0 2014-08-14
0.2.0 2014-06-15
0.1.2 2014-05-11
0.1.1 2014-04-21
0.1.0 2014-04-20