Get metadata of a package from the npm registry
$ npm install --save package-json
const packageJson = ;;// Also works with scoped packages;
Name of the package.
Package version such as
1.0.0 or a dist tag such as
The version can also be in any format supported by the semver module. For example:
1- get the latest
1.2- get the latest
^1.2.3- get the latest
1.x.xbut at least
~1.2.3- get the latest
1.2.xbut at least
By default, only an abbreviated metadata object is returned for performance reasons. Read more.
Return the main entry containing all versions.
Both public and private registries are supported, for both scoped and unscoped packages, as long as the registry uses either bearer tokens or basic authentication.
MIT © Sindre Sorhus