{"name":"package-hash","version":"4.0.0","description":"Generates a hash for an installed npm package, useful for salting caches","main":"index.js","engines":{"node":">=8"},"scripts":{"lint":"as-i-preach","unpack-fixtures":"node scripts/unpack-fixtures.js","pregenerate-fixture-index":"npm run unpack-fixtures","generate-fixture-index":"node scripts/generate-fixture-index.js","pretest":"npm run unpack-fixtures","test":"ava","posttest":"npm run lint","coverage":"nyc npm test","watch:test":"npm run test -- --watch"},"repository":{"type":"git","url":"git+https://github.com/novemberborn/package-hash.git"},"author":{"name":"Mark Wubben","url":"https://novemberborn.net/"},"license":"ISC","bugs":{"url":"https://github.com/novemberborn/package-hash/issues"},"homepage":"https://github.com/novemberborn/package-hash#readme","dependencies":{"graceful-fs":"^4.1.15","hasha":"^5.0.0","lodash.flattendeep":"^4.4.0","release-zalgo":"^1.0.0"},"devDependencies":{"@novemberborn/as-i-preach":"^11.0.0","ava":"^1.4.1","codecov":"^3.3.0","nyc":"^13.3.0","rimraf":"^2.6.3","tar":"^4.4.8"},"nyc":{"cache":true,"exclude":["scripts","test"],"reporter":["html","lcov","text"]},"standard-engine":"@novemberborn/as-i-preach","gitHead":"6afce110db308d4ed70dbdb5658fc4ec50522c86","_id":"package-hash@4.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"coreyfarrell","email":"git@cfware.com"},"dist":{"integrity":"sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==","shasum":"3537f654665ec3cc38827387fc904c163c54f506","tarball":"http://registry-npm.ywwl.com/package-hash/download/package-hash-4.0.0.tgz","fileCount":4,"unpackedSize":9180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrQ5GCRA9TVsSAnZWagAAlrAP/3xaHUwDLhwz+Gr9yv+8\naxmXiu80VO8fMSiSxVBKr87Iq1ncthXS44j5eIJFy0h+Rm6LIVb3Lf1fUaOO\n9ooQVUJ+tjQGXejEwNicqbiGk4xsyhENTwe/C7YRH/4WVYadyqmun38eXYvx\njzpgBkLQdl8PNU6RSySUPwcZFYhqAI0enoIsCWkn2nD5eaIdOEMUBXph0OfS\nTRn1bFUuxvGXBAro0zBMs94NSBwt/zpyv6pWqdej18EKTdkmoRDGs3Dh1Wjy\nZdavO8S/nYfWlyNTttaxO88fbva8gYNNjQF7/i+ki4wd+Mwc3gDM9HYOxZtb\nwEKn0KqlUUAOCHIDBxskVMXjZdRZgfZY4l8DhR2frlzRE0+KSc7wAFAnVrb1\nAKyLLp/hrnENahV5d0VNoMKQFwbC6KCI4RmsxkU6Wc69kr0LNbSjRszVNdnt\nUZ1Y1QsxHu5/3guO3QC/V09vlnnIFt6UxkH//O2Mc98go3R5fTYzSt/k9s8v\nAtNbPyssHxOsdN7xhZdoa4KyJb1EQRuE7XDJE6No8bZB3cNgH1/PRFWQKNh0\ncXeuSquTNPRLDN8JGY0122Zzf3ZFOfGvpTfyzwqIV6OqTqiELQGeC3Glj4Sm\nRRXjFuxvGTyF+BXaBoCK0vnowUNwh6YIXt0t4MqhIfQd+pwdGj+ZvIQgcee2\nMhD7\r\n=8KO1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICuNpnOAAnVVXJRee294Krbyh5S6IxNDmkxKb3/sKL8WAiEAmUuRDikOw6IwEr/AaXmz7tr5ul7njalYfipNlokp62g="}],"size":3717,"noattachment":false,"key":"/package-hash/-/package-hash-4.0.0.tgz"},"maintainers":[{"email":"git@cfware.com","name":"coreyfarrell"},{"email":"mark@novemberborn.net","name":"novemberborn"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/package-hash_4.0.0_1554845253173_0.6326632071221292"},"_hasShrinkwrap":false,"readme":"# package-hash\n\nGenerates a hash for an installed npm package, useful for salting caches.\n[AVA](https://github.com/sindresorhus/ava) for example caches precompiled test\nfiles. It generates a salt for its cache based on the various packages that are\nused when compiling the test files.\n\n`package-hash` can generate an appropriate hash based on the package location\n(on disk) and the `package.json` file. This hash is salted with a hash\nfor the `package-hash` itself.\n\n`package-hash` can detect when the package-to-be-hashed is a Git repository. In\nthe AVA example this is useful when you're debugging one of the packages used to\ncompile the test files. You can clone it locally and use `npm link` so AVA can\nfind the clone. The hash will include the HEAD (`.git/HEAD`) and its\ncorresponding ref (e.g. `.git/refs/heads/master`), any packed refs\n(`.git/packed-refs`), as well as the diff (`git diff`) for any non-committed\nchanges. This makes it really easy to test your changes without having to\nexplicitly clear the cache in the parent project.\n\n## Installation\n\n```console\n$ npm install --save package-hash\n```\n\n## Usage\n\n```js\nconst packageHash = require('package-hash')\n\n// Asynchronously:\nconst hash = await packageHash(require.resolve('babel-core/package.json'))\n\n// Synchronously:\nconst hash = packageHash.sync(require.resolve('babel-core/package.json'))\n```\n\n`packageHash()` / `packageHash.sync()` must be called with a file path for an\nexisting `package.json` file. To get the path to an npm package it's easiest to\nuse `require.resolve('the-name/package.json')`.\n\nYou can provide multiple paths:\n\n```js\nconst hash = await packageHash([\n  require.resolve('babel-core/package.json'),\n  require.resolve('babel-preset-es2015/package.json')\n])\n```\n\nAn optional salt value can also be provided:\n\n```js\nconst hash = await packageHash(require.resolve('babel-core/package.json'), 'salt value')\n```\n\n## API\n\n### `packageHash(paths, salt?)`\n\n`paths: string | string[]` ➜ can be a single file path, or an array of paths.\n\n`salt: Array | Buffer | Object | string` ➜ optional. If an `Array` or `Object` (not `null`) it is first converted to a JSON string.\n\nReturns a promise for the hex-encoded hash string.\n\n### `packageHash.sync(paths, salt?)`\n\n`paths: string | string[]` ➜ can be a single file path, or an array of paths.\n\n`salt: Array | Buffer | Object | string` ➜ optional. If an `Array` or `Object` (not `null`) it is first converted to a JSON string.\n\nReturns a hex-encoded hash string.\n\n## Compatibility\n\n`package-hash` has been tested with Node.js 8 and above, including Windows\nsupport.\n","publish_time":1554845253385,"_cnpm_publish_time":1554845253385,"dist-tags":{"latest":"4.0.0"}}