{ "_id": "package-hash", "_rev": "8-3302f74dacfb874116c4918d8071af9b", "name": "package-hash", "description": "Generates a hash for an installed npm package, useful for salting caches", "dist-tags": { "latest": "4.0.0" }, "versions": { "1.0.0": { "name": "package-hash", "version": "1.0.0", "description": "Generates a hash for an installed npm package, useful for salting caches", "main": "index.js", "files": [ "index.js", "index.js.map" ], "scripts": { "clean": "rimraf index.js index.js.map", "prebuild": "npm run clean", "build": "babel src --out-dir ./ --source-maps", "prepublish": "npm run build", "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:build": "npm run build -- --watch", "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": { "md5-hex": "^1.3.0" }, "devDependencies": { "@novemberborn/as-i-preach": "^2.0.1", "ava": "^0.14.0", "babel-cli": "^6.7.5", "babel-plugin-transform-es2015-block-scoping": "^6.7.1", "babel-plugin-transform-es2015-modules-commonjs": "^6.7.4", "babel-plugin-transform-es2015-shorthand-properties": "^6.5.0", "babel-plugin-transform-object-assign": "^6.5.0", "babel-plugin-transform-strict-mode": "^6.6.5", "nyc": "^6.4.0", "proxyquire": "^1.7.4", "rimraf": "^2.5.2", "tar": "^2.2.1" }, "babel": { "plugins": [ "transform-object-assign", "transform-es2015-block-scoping", "transform-es2015-modules-commonjs", "transform-es2015-shorthand-properties", "transform-strict-mode" ] }, "nyc": { "cache": true, "exclude": [ "scripts", "test" ], "reporter": [ "html", "lcov", "text" ] }, "gitHead": "69a328840818d336ae13af22f9af092208fcb49b", "_id": "package-hash@1.0.0", "_shasum": "8a56413d7754562e651917fc4b4399f704e19af8", "_from": ".", "_npmVersion": "3.8.6", "_nodeVersion": "5.10.1", "_npmUser": { "name": "novemberborn", "email": "mark@novemberborn.net" }, "dist": { "shasum": "8a56413d7754562e651917fc4b4399f704e19af8", "tarball": "https://registry.npmjs.org/package-hash/-/package-hash-1.0.0.tgz" }, "maintainers": [ { "name": "novemberborn", "email": "mark@novemberborn.net" } ], "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/package-hash-1.0.0.tgz_1460655212274_0.9062121566385031" }, "directories": {} }, "1.1.0": { "name": "package-hash", "version": "1.1.0", "description": "Generates a hash for an installed npm package, useful for salting caches", "main": "index.js", "files": [ "index.js", "index.js.map" ], "scripts": { "clean": "rimraf index.js index.js.map", "prebuild": "npm run clean", "build": "babel src --out-dir ./ --source-maps", "prepublish": "npm run build", "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:build": "npm run build -- --watch", "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": { "md5-hex": "^1.3.0" }, "devDependencies": { "@novemberborn/as-i-preach": "^2.0.1", "ava": "^0.14.0", "babel-cli": "^6.7.5", "babel-plugin-transform-es2015-block-scoping": "^6.7.1", "babel-plugin-transform-es2015-modules-commonjs": "^6.7.4", "babel-plugin-transform-es2015-shorthand-properties": "^6.5.0", "babel-plugin-transform-object-assign": "^6.5.0", "babel-plugin-transform-strict-mode": "^6.6.5", "nyc": "^6.4.0", "proxyquire": "^1.7.4", "rimraf": "^2.5.2", "tar": "^2.2.1" }, "babel": { "plugins": [ "transform-object-assign", "transform-es2015-block-scoping", "transform-es2015-modules-commonjs", "transform-es2015-shorthand-properties", "transform-strict-mode" ] }, "nyc": { "cache": true, "exclude": [ "scripts", "test" ], "reporter": [ "html", "lcov", "text" ] }, "gitHead": "a254af98aff451f6547671c341c17ddc16e2d098", "_id": "package-hash@1.1.0", "_shasum": "a1436137d864b752396fa1f057772ce5fe7d8c3c", "_from": ".", "_npmVersion": "3.8.7", "_nodeVersion": "5.10.1", "_npmUser": { "name": "novemberborn", "email": "mark@novemberborn.net" }, "dist": { "shasum": "a1436137d864b752396fa1f057772ce5fe7d8c3c", "tarball": "https://registry.npmjs.org/package-hash/-/package-hash-1.1.0.tgz" }, "maintainers": [ { "name": "novemberborn", "email": "mark@novemberborn.net" } ], "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", "tmp": "tmp/package-hash-1.1.0.tgz_1460912724001_0.09321424411609769" }, "directories": {} }, "1.2.0": { "name": "package-hash", "version": "1.2.0", "description": "Generates a hash for an installed npm package, useful for salting caches", "main": "index.js", "files": [ "index.js", "index.js.map" ], "scripts": { "clean": "rimraf index.js index.js.map", "prebuild": "npm run clean", "build": "babel src --out-dir ./ --source-maps", "prepublish": "npm run build", "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:build": "npm run build -- --watch", "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": { "md5-hex": "^1.3.0" }, "devDependencies": { "@novemberborn/as-i-preach": "^2.0.1", "ava": "^0.14.0", "babel-cli": "^6.7.5", "babel-plugin-transform-es2015-block-scoping": "^6.7.1", "babel-plugin-transform-es2015-modules-commonjs": "^6.7.4", "babel-plugin-transform-es2015-shorthand-properties": "^6.5.0", "babel-plugin-transform-object-assign": "^6.5.0", "babel-plugin-transform-strict-mode": "^6.6.5", "nyc": "^6.4.0", "proxyquire": "^1.7.4", "rimraf": "^2.5.2", "tar": "^2.2.1" }, "babel": { "plugins": [ "transform-object-assign", "transform-es2015-block-scoping", "transform-es2015-modules-commonjs", "transform-es2015-shorthand-properties", "transform-strict-mode" ] }, "nyc": { "cache": true, "exclude": [ "scripts", "test" ], "reporter": [ "html", "lcov", "text" ] }, "gitHead": "2a14f0f767017f941aab62cd44c3c14689f6b843", "_id": "package-hash@1.2.0", "_shasum": "003e56cd57b736a6ed6114cc2b81542672770e44", "_from": ".", "_npmVersion": "3.8.7", "_nodeVersion": "5.10.1", "_npmUser": { "name": "novemberborn", "email": "mark@novemberborn.net" }, "dist": { "shasum": "003e56cd57b736a6ed6114cc2b81542672770e44", "tarball": "https://registry.npmjs.org/package-hash/-/package-hash-1.2.0.tgz" }, "maintainers": [ { "name": "novemberborn", "email": "mark@novemberborn.net" } ], "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", "tmp": "tmp/package-hash-1.2.0.tgz_1463403606290_0.8582867733202875" }, "directories": {} }, "2.0.0": { "name": "package-hash", "version": "2.0.0", "description": "Generates a hash for an installed npm package, useful for salting caches", "main": "index.js", "files": [ "index.js" ], "engines": { "node": ">=4" }, "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.11", "lodash.flattendeep": "^4.4.0", "md5-hex": "^2.0.0", "release-zalgo": "^1.0.0" }, "devDependencies": { "@novemberborn/as-i-preach": "^7.0.0", "ava": "^0.18.0", "coveralls": "^2.11.15", "nyc": "^10.0.0", "rimraf": "^2.5.2", "tar": "^2.2.1" }, "nyc": { "cache": true, "exclude": [ "scripts", "test" ], "reporter": [ "html", "lcov", "text" ] }, "standard-engine": "@novemberborn/as-i-preach", "gitHead": "764189d31b2a659051b7b6b7a784095e8ce22863", "_id": "package-hash@2.0.0", "_shasum": "78ae326c89e05a4d813b68601977af05c00d2a0d", "_from": ".", "_npmVersion": "4.1.2", "_nodeVersion": "7.4.0", "_npmUser": { "name": "novemberborn", "email": "mark@novemberborn.net" }, "dist": { "shasum": "78ae326c89e05a4d813b68601977af05c00d2a0d", "tarball": "https://registry.npmjs.org/package-hash/-/package-hash-2.0.0.tgz" }, "maintainers": [ { "name": "novemberborn", "email": "mark@novemberborn.net" } ], "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/package-hash-2.0.0.tgz_1486138677677_0.8842510140966624" }, "directories": {} }, "3.0.0": { "name": "package-hash", "version": "3.0.0", "description": "Generates a hash for an installed npm package, useful for salting caches", "main": "index.js", "engines": { "node": ">=6" }, "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": "^3.0.0", "lodash.flattendeep": "^4.4.0", "release-zalgo": "^1.0.0" }, "devDependencies": { "@novemberborn/as-i-preach": "^11.0.0", "ava": "^1.1.0", "codecov": "^3.1.0", "nyc": "^13.1.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": "d2682c959cb26013b31eb30595449f057b28904e", "_id": "package-hash@3.0.0", "_npmVersion": "6.4.1", "_nodeVersion": "10.14.0", "_npmUser": { "name": "novemberborn", "email": "mark@novemberborn.net" }, "dist": { "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", "shasum": "50183f2d36c9e3e528ea0a8605dff57ce976f88e", "tarball": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", "fileCount": 4, "unpackedSize": 9351, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPwnqCRA9TVsSAnZWagAA3z4QAJqtPina3HyREjZ/2ZvR\nU1c5ULs3Cf2UFAKEvNuj6CgFhF7pf+5RYGl6Xi0SjL8UU6I9NdhJhgKfZkl+\npPHQOWJZrI3DgSP/4HI9O9x69GGMj1TWtOWdQw342sN+9+gukp5BNB1bhJ/P\nguZ4gAbeJ3iATXevDQ8bFy9Xyzhn6UmwTr0UmluIhoIw7eI/r8Tk4QvjkSJ9\nmWoD8fnQexfgDawdM7FX6VPd1QGMA+TYGACy5vOJ8ze0FgNr6ZmbLeXPxg2R\nqwj49j14v3ir5XV/vsDfJHfSkDbKunxO7FcQwicirJYmnoZJNb0NMm9KBnhf\n1P6KSLVleJU3bJgIqMX9zpGiDWc/yc3GyeGdzrjJB4zhVlUN0wisqG7NN2IR\nekK5DKmSplxdt9Xg/D7Qe0U1v7eD6PXo33MoRc8vNHgvEBZvn4X/3HH0vdum\nmV0xsjxZ6kpy+UBGFWfvfpqoifU5Fx3lAZbcD2KYM6xjSUssIGLf811WWif8\nLlj1egiRT4LzfAT9YaDt/GEZfgpbTPTYGZP3RsVHglj1NqPubh//+lgPzKsu\nfahsQ2NSWgoqhmNRO/SJH+5zyD46QZjfX+MWgQ2rwTsXmt38z+jvbQ1LgnnA\ntB5LQkZ1/IlpzTd3MZr4SIeZmS1UMGWGMC1+6hrqSwt+3EkfByaEOvMpJDxi\nR/HP\r\n=ERA3\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "novemberborn", "email": "mark@novemberborn.net" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/package-hash_3.0.0_1547635177860_0.037036260692207223" }, "_hasShrinkwrap": false }, "4.0.0": { "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": "https://registry.npmjs.org/package-hash/-/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" }, "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", "maintainers": [ { "email": "git@cfware.com", "name": "coreyfarrell" }, { "email": "mark@novemberborn.net", "name": "novemberborn" } ], "time": { "modified": "2019-04-09T21:27:37.754Z", "created": "2016-04-14T17:33:34.885Z", "1.0.0": "2016-04-14T17:33:34.885Z", "1.1.0": "2016-04-17T17:05:25.230Z", "1.2.0": "2016-05-16T13:00:08.288Z", "2.0.0": "2017-02-03T16:17:59.390Z", "3.0.0": "2019-01-16T10:39:37.952Z", "4.0.0": "2019-04-09T21:27:33.385Z" }, "homepage": "https://github.com/novemberborn/package-hash#readme", "repository": { "type": "git", "url": "git+https://github.com/novemberborn/package-hash.git" }, "author": { "name": "Mark Wubben", "url": "https://novemberborn.net/" }, "bugs": { "url": "https://github.com/novemberborn/package-hash/issues" }, "license": "ISC", "readmeFilename": "README.md", "users": { "novemberborn": true } }