npm.io
2.0.3 • Published 1 year ago

npm-package-versions

Licence
MIT
Version
2.0.3
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
5

npm-package-versions

Get an array of all available versions of a given npm package.

js-standard-style

Installation

npm install npm-package-versions --save

Usage

const pkgVersions = require('npm-package-versions')

pkgVersions('bonjour', function (err, versions) {
  if (err) throw err
  console.log('Bonjour package versions available:')
  versions.forEach(function (version) {
    console.log('- %s', version)
  })
})

Optionally supply a custom registry URL (will default to https://registry.npmjs.org if not provided):

pkgVersions('bonjour', 'https://registry.example.com', function (err, versions) {
  // ...
})

API

pgkVersions.uri

Set this property to overwrite the default registry URI.

Defaults to https://registry.npmjs.org/

pkgVersions.params

Set the property to overwrite the default npm-registry-client params for client.get.

Defaults to {}.

License

MIT

Keywords