version-to-commit

1.1.0 • Public • Published

version-to-commit

NPM

cli and function for returning the git sha commit hash for a certain npm module and version.

Works by checking the gitHead attribute on the registry. This is not available on all packages and versions. If you have an idea how to deal with it otherwise, let me know.

usage

var toCommit = require('version-to-commit')
 
toCommit('dat', '5.0.0', 'https://registry.npmjs.org', function (err, commit) {
  console.log(commit) // returns 60c535343b30eb7aa93f754f7c73ebd61ca94ee4
})
 

The second and the third parameter are optional and will default to latest and https://registry.npmjs.org.

cli

usage: version-to-commit [modulename] [version]

Defaults to the module in the current working directory and the latest version.

Package Sidebar

Install

npm i version-to-commit

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • jackmellis
  • finnpauls