get npm package version
npm i get-npm-package-version
const version = require('get-npm-package-version')(packageName[, { registry, timeout }]);
packageName
— packageNameregistry
— npm registry when getting versiontimeout
— timeout when getting version
- return
null
when timeout or error happens - return version when getting version successfully
ISC