mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
2.5 KiB
31 lines
2.5 KiB
{
|
|
"name": "sha",
|
|
"version": "1.2.3",
|
|
"description": "Check and get file hashes",
|
|
"scripts": {
|
|
"test": "mocha -R spec"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/ForbesLindesay/sha.git"
|
|
},
|
|
"license": "BSD",
|
|
"optionalDependencies": {
|
|
"graceful-fs": "2",
|
|
"readable-stream": "1.0"
|
|
},
|
|
"devDependencies": {
|
|
"mocha": "~1.9.0"
|
|
},
|
|
"readme": "# sha\r\n\r\nCheck and get file hashes (using any algorithm)\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)\r\n[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha)\r\n\r\n## Installation\r\n\r\n $ npm install sha\r\n\r\n## API\r\n\r\n### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])\r\n\r\nAsynchronously check that `fileName` has a \"hash\" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### get(fileName, [options,] cb) / getSync(filename, [options])\r\n\r\nAsynchronously get the \"hash\" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### stream(expected, [options])\r\n\r\nCheck the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:\r\n\r\n```js\r\nfs.createReadStream('src')\r\n .pipe(sha.stream('expected'))\r\n .pipe(fs.createWriteStream('dest'))\r\n```\r\n\r\n`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n## License\r\n\r\nYou may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.",
|
|
"readmeFilename": "README.md",
|
|
"bugs": {
|
|
"url": "https://github.com/ForbesLindesay/sha/issues"
|
|
},
|
|
"dependencies": {
|
|
"graceful-fs": "2",
|
|
"readable-stream": "1.0"
|
|
},
|
|
"_id": "sha@1.2.3",
|
|
"_from": "sha@latest"
|
|
}
|
|
|