JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 135610
  • Score
    100M100P100Q172360F
  • License MIT

Find the latest version of an npm module matching a given semver range

Package Exports

  • get-latest-version

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-latest-version) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

get-latest-version

Find the latest version of an npm module matching a given semver range

npm versionBuild Status

Installing

npm install --save get-latest-version

Basic usage

const getLatestVersion = require('get-latest-version')

getLatestVersion('some-module')
  .then(version => console.log(version)) // 1.0.0, or whichever is 'latest'
  .catch(err => console.error(err))

getLatestVersion('some-other-module', {range: '^1.0.0'})
  .then(version => console.log(version)) // highest version matching ^1.0.0 range
  .catch(err => console.error(err))

Disabling authenticated requests

By default, this module will read the authorization token for whichever registry the module belongs to, based on local npm configuration. To disable this and always send unauthenticated requests to the registry, provide auth: false to the options:

getLatestVersion('some-module', {auth: false})
  .then(version => console.log(version))
  .catch(err => console.error(err))

Developing

git clone git@github.com:rexxars/get-latest-version.git
cd get-latest-version
npm install
npm test

License

MIT © Espen Hovlandsdal