package-version
v1.0.0
Published
package-version
Downloads
49
Readme
package-version
Get the version of a package from package.json
Installation
npm install package-version --save
version(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
path
the directory of the package - callback
function(err, version)
- err
Error
- version
semver
- err