latest-version

Get the latest version of an npm package

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

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

License

MIT © Sindre Sorhus

Repository

sindresorhus/latest-version


上一篇:collect-stream
下一篇:is-yarn-global

相关推荐

  • 使用 core-version-manager 解决版本号的问题

    最近在写工具处理的时候,想到做这么一个库,用于解决版本号之间的问题,比如打小,比较等问题。常见的比如确定 A/B 两个版本谁比较新,又或者 选出一系列版本中最大的。

    2 年前
  • 代码风格统一:commitlint & eslint & standard-version

    Commitlint 配置 添加包 yarn add @commitlint/cli @commitlint/config-conventional husky -D 配置package.json ...

    2 年前
  • win-version-info

    Windows-only native addon to read version info from executables win-version-info Windows-only native...

    2 年前
  • webpack-auto-inject-version

    Webpack plugin for auto inject version from package.json Auto inject version - Webpack plugin Adds v...

    3 个月前
  • webidl-conversions

    Implements the WebIDL algorithms for converting to and from JavaScript values Web IDL Type Conversio...

    2 年前
  • versiony

    A module to increment version number for your code/module. Support for npm/bower/custom files. versi...

    1 年前
  • versionup

    Increment version number in package.json (or bower.json) versionup Increment version num...

    1 年前
  • versions

    CLI to flexibly increment a project's version versions CLI to flexibly increment a project's vers...

    2 天前
  • version-ts

    Node utility to merge typescript version file into browser library. gulp-version-ts Gulp versioning ...

    2 个月前
  • version-tree

    Version tracking data structure version-tree A data structure for maintaining a tree of versions. T...

    2 年前

官方社区

扫码加入 JavaScript 社区