1.0.0 • Published 10 years ago
package-version v1.0.0
package-version
Get the version of a package from package.json
Installation
npm install package-version --saveversion(cwd, callback);
var version = require('package-version');
version('/path/to', function(err, version){
if(err){
console.log('error:', err.stack);
return;
}
console.log('version:', version);
});- cwd
paththe directory of the package - callback
function(err, version)- err
Error - version
semver
- err