npm install registry-package-info
const getRegistryPkgInfo = require('registry-package-info');
/* get the latest version package info from npm registry */
getRegistryPkgInfo('react',{
registry:'http://registry.npmjs.org',
version:'latest'
})
.then(function(data){
console.dir(data);
})
.catch(function(e){
console.log(e);
})
getRegistryPkgInfo ( pkgname, options );
parameter | description | default | required |
---|---|---|---|
pkgname | string | null | Y |
options | object | { version:'latest', registry:'http://registry.npmjs.org' } | N |
registry-pkg-info is MIT licensed.