pkg-versions

Get the version numbers of a package from the npm registry

Usage no npm install needed!

<script type="module">
  import pkgVersions from 'https://cdn.skypack.dev/pkg-versions';
</script>

README

pkg-versions Build Status

Get the version numbers of a package from the npm registry

Install

$ npm install pkg-versions

Usage

const pkgVersions = require('pkg-versions');

(async () => {
    console.log(await pkgVersions('ava'));
    //=> {'0.0.3', '0.0.4', …}
})();

API

pkgVersions(packageName)

Returns a Promise<Set<string>> with the versions.

packageName

Type: string

The name of the package to look up versions for.

Related

  • package-json - Get the package.json of a package from the npm registry
  • latest-version - Get the latest version of an npm package
  • npm-keyword - Get a list of npm packages with a certain keyword
  • npm-user - Get user info of an npm user
  • npm-email - Get the email of an npm user

License

MIT © Sindre Sorhus