latest-version

2020-02-15

latest-version

Get the latest version of an npm package

build status">latest-version Build Status

Get the latest version of an npm package

Fetches the version directly from the registry instead of depending on the massive npmmodule like the latestmodule does.

Install

$ npm install latest-version

Usage

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


Get professional support for this package with a Tidelift subscriptionTidelift helps make open source sustainable for maintainers while giving companies assurances about security, maintenance, and licensing for their dependencies.

以上是 latest-version 的使用教程帮助文档。


上一篇:collect-stream
下一篇:is-yarn-global
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部