{"_id":"hash-replace","_rev":"7-ccdad7b37b8cda9ace26399a9548429f","name":"hash-replace","dist-tags":{"latest":"1.0.5"},"versions":{"0.0.0":{"name":"hash-replace","version":"0.0.0","description":"","main":"index.js","scripts":{},"license":"MIT","_id":"hash-replace@0.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-n0xpMQUNGUVuApeu32LvTQEIkHfcy1H4pCyfq7/KEGtNFxueKFZSJzWSrUwqsfUWE8rAHTpWx0i87JArPoLGMw==","shasum":"ef8b157044cab1caa64bd1383707b426fabbb8f0","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-0.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/ZzB5re0U5J4XTHvxXkP6Ir3zLDChVngQU0Ry8/A5JAIhAKNlWTpFmdlmCBsQSDG+UMnSJWUEOJL/HW5RJMm+SYnT"}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-0.0.0.tgz_1504185063172_0.79592818999663"}},"1.0.0":{"name":"hash-replace","version":"1.0.0","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","main":"lib/index.js","scripts":{"build":"BABEL_ENV=production babel src --out-dir lib","test":"npm run build && nyc ava --verbose --timeout=10s","prepublish":"npm run build","report-cov":"nyc report --reporter=text-lcov > coverage.lcov && codecov"},"files":["lib/"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"keywords":["hash-replace","replace","hash","webpack"],"engines":{"node":">=4"},"author":{"name":"kaelzhang"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"},"ava":{"require":"babel-register","babel":{"babelrc":true},"files":["test/*.js"]},"devDependencies":{"ava":"^0.16.0","babel-cli":"^6.16.0","babel-plugin-syntax-trailing-function-commas":"^6.13.0","babel-plugin-transform-async-to-generator":"^6.22.0","babel-plugin-transform-class-properties":"^6.16.0","babel-plugin-transform-exponentiation-operator":"^6.8.0","babel-plugin-transform-inline-environment-variables":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.16.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","codecov":"^2.3.0","loader-utils":"^1.1.0","nyc":"^11.1.0"},"dependencies":{"babel-runtime":"^6.23.0"},"gitHead":"20052717609e8dd0e8e4b92f28934b6b0a04f7b8","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","_id":"hash-replace@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-EEuqLpdLOOyGa8SXfatczxrvfOKmGMhvWNSPiNLct671xXa+7wHMSQgzpD+jfBjf30Fp4OSi9H+BWPbA2PL60A==","shasum":"c2c0fc9cb88412b1c9009caeddb67b0a603ba213","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHwN04hdoEzw6kCMFWDEoq8GVy6hi1dpzyxDxUZn2jDICIQCDPbegiKF622WqbkoH5LBRTUnI2eqmxW4hQM9b3n1hSA=="}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-1.0.0.tgz_1504192725879_0.9847727091982961"}},"1.0.1":{"name":"hash-replace","version":"1.0.1","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","main":"lib/index.js","scripts":{"build":"BABEL_ENV=production babel src --out-dir lib","test":"npm run build && nyc ava --verbose --timeout=10s","prepublish":"npm run build","report-cov":"nyc report --reporter=text-lcov > coverage.lcov && codecov"},"files":["lib/"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"keywords":["hash-replace","replace","hash","webpack"],"engines":{"node":">=4"},"author":{"name":"kaelzhang"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"},"ava":{"require":"babel-register","babel":{"babelrc":true},"files":["test/*.js"]},"devDependencies":{"ava":"^0.16.0","babel-cli":"^6.16.0","babel-plugin-syntax-trailing-function-commas":"^6.13.0","babel-plugin-transform-async-to-generator":"^6.22.0","babel-plugin-transform-class-properties":"^6.16.0","babel-plugin-transform-exponentiation-operator":"^6.8.0","babel-plugin-transform-inline-environment-variables":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.16.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","codecov":"^2.3.0","nyc":"^11.1.0"},"dependencies":{"babel-runtime":"^6.23.0","loader-utils":"^1.1.0"},"gitHead":"bfc5e81843c62aef1af32bf7674ec5f14daafa54","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","_id":"hash-replace@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-rJ/D+v6ZZXrPue58TKDDgLBP/WrwCL2ecTLtbweIPFiFq7fUnR71dLivr3LeukaQOj/x+MEONTDdNU2OcT9C/A==","shasum":"f9cc6cd0fa4789ab75d998d79f4d93c4a53b01c6","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAH9TS5g6W7gVaWp/svQRo9v2/ua+M+VZxzGJCy0YLFmAiBTYMo5PkBphZFHdu0PP53T8j4+WUyYvJexd6Bgl486aQ=="}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-1.0.1.tgz_1504194635350_0.5653100074268878"}},"1.0.2":{"name":"hash-replace","version":"1.0.2","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","main":"lib/index.js","scripts":{"build":"BABEL_ENV=production babel src --out-dir lib","test":"npm run build && nyc ava --verbose --timeout=10s","prepublish":"npm run build","report-cov":"nyc report --reporter=text-lcov > coverage.lcov && codecov"},"files":["lib/"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"keywords":["hash-replace","replace","hash","webpack"],"engines":{"node":">=4"},"author":{"name":"kaelzhang"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"},"ava":{"require":"babel-register","babel":{"babelrc":true},"files":["test/*.js"]},"devDependencies":{"ava":"^0.16.0","babel-cli":"^6.16.0","babel-plugin-syntax-trailing-function-commas":"^6.13.0","babel-plugin-transform-async-to-generator":"^6.22.0","babel-plugin-transform-class-properties":"^6.16.0","babel-plugin-transform-exponentiation-operator":"^6.8.0","babel-plugin-transform-inline-environment-variables":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.16.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","codecov":"^2.3.0","nyc":"^11.1.0"},"dependencies":{"babel-runtime":"^6.23.0","loader-utils":"^1.1.0"},"gitHead":"9a656fc4aa0b5e00c30454537d333185b8ce92ef","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","_id":"hash-replace@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-4ZdvNLrKl5fBEcwNG/r5w12CQW8Hs7BLFatPr3Yf56fVYf5b4sKKFPlD2LJhle0v5cK5TM3ciWXQzfPDEGp8jw==","shasum":"f872210bf6ecca4c2a8f261cfcaa409376b39a2d","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH/W+EbjohPplFyj7aXjXzyDFR3AiUEKkFxlPGyh4cTYAiEA7C5KAdy8iPv2k9q/v9BAZgqPmTFsbb3GTObntuO56t8="}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-1.0.2.tgz_1504196870338_0.145410189172253"}},"1.0.3":{"name":"hash-replace","version":"1.0.3","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","main":"lib/index.js","scripts":{"build":"BABEL_ENV=production babel src --out-dir lib","test":"npm run build && nyc ava --verbose --timeout=10s","prepublish":"npm run build","report-cov":"nyc report --reporter=text-lcov > coverage.lcov && codecov"},"files":["lib/"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"keywords":["hash-replace","replace","hash","webpack","digest","contenthash","chunkhash","hash"],"engines":{"node":">=4"},"author":{"name":"kaelzhang"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"},"ava":{"require":"babel-register","babel":{"babelrc":true},"files":["test/*.js"]},"devDependencies":{"ava":"^0.16.0","babel-cli":"^6.16.0","babel-plugin-syntax-trailing-function-commas":"^6.13.0","babel-plugin-transform-async-to-generator":"^6.22.0","babel-plugin-transform-class-properties":"^6.16.0","babel-plugin-transform-exponentiation-operator":"^6.8.0","babel-plugin-transform-inline-environment-variables":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.16.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","codecov":"^2.3.0","nyc":"^11.1.0"},"dependencies":{"babel-runtime":"^6.23.0","loader-utils":"^1.1.0"},"gitHead":"1a8f9c62abaa48891ce94b7adea3b5974e7fae18","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","_id":"hash-replace@1.0.3","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-+LVMPMiCVBwQypdbwXEvLSeqOe4WiQTMqh6k5mVmXFuRgQLU6hpJ9GDNmh9Hk/9hNRraNAgOQJlj2VDBET5qRA==","shasum":"9b35595676a1f6bc453b35b33cdb718a6bf069ad","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-1.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2G0jdcAmGoBKqiR3cbYw4SxMYbDPCieMG/fA82vwihgIhAPtr1c2AybsflZYmaElQqX4oimGnJv7AvclfdKXwI5R3"}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-1.0.3.tgz_1504198535700_0.7720703603699803"}},"1.0.4":{"name":"hash-replace","version":"1.0.4","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","main":"lib/index.js","scripts":{"build":"BABEL_ENV=production babel src --out-dir lib","test":"npm run build && nyc ava --verbose --timeout=10s","prepublish":"npm run build","report-cov":"nyc report --reporter=text-lcov > coverage.lcov && codecov"},"files":["lib/"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"keywords":["hash-replace","replace","hash","webpack","digest","contenthash","chunkhash","hash"],"engines":{"node":">=4"},"author":{"name":"kaelzhang"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"},"ava":{"require":"babel-register","babel":{"babelrc":true},"files":["test/*.js"]},"devDependencies":{"ava":"^0.16.0","babel-cli":"^6.16.0","babel-plugin-syntax-trailing-function-commas":"^6.13.0","babel-plugin-transform-async-to-generator":"^6.22.0","babel-plugin-transform-class-properties":"^6.16.0","babel-plugin-transform-exponentiation-operator":"^6.8.0","babel-plugin-transform-inline-environment-variables":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.16.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","codecov":"^2.3.0","nyc":"^11.1.0"},"dependencies":{"babel-runtime":"^6.23.0","loader-utils":"^1.1.0"},"gitHead":"c9a868f55759e3ffed3c295d35f378d5158af041","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","_id":"hash-replace@1.0.4","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-9DLpfJNZUee9qR8X6w3lAYhUU/UYOE25zk691fkB1SVK7RAtkyqLrtmPwbZbZfLhpDjjGAQZZCyqOpA5KxZT+g==","shasum":"e261f7e77eacad440b53f8fddbb6e9608e1ae14c","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-1.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXs5iaVgPD5OMSQlUMxN7oRWfcmKak6ojKMv9awYwt0AiA9vyys580E1aqMuUZsFMSRco61C7Pq8JzT87pxKYcSVw=="}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-1.0.4.tgz_1504502939240_0.48513529170304537"}},"1.0.5":{"name":"hash-replace","version":"1.0.5","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","main":"lib/index.js","scripts":{"build":"BABEL_ENV=production babel src --out-dir lib","test":"npm run build && nyc ava --verbose --timeout=10s","prepublish":"npm run build","report-cov":"nyc report --reporter=text-lcov > coverage.lcov && codecov"},"files":["lib/"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"keywords":["hash-replace","replace","hash","webpack","digest","contenthash","chunkhash","hash"],"engines":{"node":">=4"},"author":{"name":"kaelzhang"},"license":"MIT","bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"},"ava":{"require":"babel-register","babel":{"babelrc":true},"files":["test/*.js"]},"devDependencies":{"ava":"^0.16.0","babel-cli":"^6.16.0","babel-plugin-syntax-trailing-function-commas":"^6.13.0","babel-plugin-transform-async-to-generator":"^6.22.0","babel-plugin-transform-class-properties":"^6.16.0","babel-plugin-transform-exponentiation-operator":"^6.8.0","babel-plugin-transform-inline-environment-variables":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.16.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","codecov":"^2.3.0","nyc":"^11.1.0"},"dependencies":{"babel-runtime":"^6.23.0","loader-utils":"^1.1.0"},"gitHead":"1c17fbae2d79ccc43626fd220a776d8aaf126d77","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","_id":"hash-replace@1.0.5","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kael","email":"i@kael.me"},"dist":{"integrity":"sha512-Im70BM+kD9DB8HJv7Cy2Qz5HviYNvE7wFxBMt2N7byQGzB/NmP/s+aCiAhltNEK1BWG3Cj9qRRKVT2AUML+c2A==","shasum":"5b817934c0bb456f30fa71f12963931a903d9d74","tarball":"https://registry.npmjs.org/hash-replace/-/hash-replace-1.0.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfdbbhYWiuG06ZN7pe222N0gTJYCSPHodSOJ1iskiMWAiAAi7tR/qnb17JoPUig8Zk73Vu5tNGnP7dB7viavmrK0w=="}]},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-replace-1.0.5.tgz_1504503041612_0.9112137828487903"}}},"readme":"[![Build Status](https://travis-ci.org/kaelzhang/node-hash-replace.svg?branch=master)](https://travis-ci.org/kaelzhang/node-hash-replace)\n[![Coverage](https://codecov.io/gh/kaelzhang/node-hash-replace/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/node-hash-replace)\n<!-- optional appveyor tst\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-hash-replace?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/node-hash-replace)\n-->\n<!-- optional npm version\n[![NPM version](https://badge.fury.io/js/hash-replace.svg)](http://badge.fury.io/js/hash-replace)\n-->\n<!-- optional npm downloads\n[![npm module downloads per month](http://img.shields.io/npm/dm/hash-replace.svg)](https://www.npmjs.org/package/hash-replace)\n-->\n<!-- optional dependency status\n[![Dependency Status](https://david-dm.org/kaelzhang/node-hash-replace.svg)](https://david-dm.org/kaelzhang/node-hash-replace)\n-->\n\n# hash-replace\n\nSubstitute a webpack-style hash template string.\n\n## Install\n\n```sh\n$ npm install hash-replace --save\n```\n\n## Usage\n\n```js\nimport replace from 'hash-replace'\nconst r = replace('hash')\n\n// example-1\n// only replace [hash], but not [chunkhash]\nr('file.[hash:7].[chunkhash]', 'aGFzaC1yZXBsYWNl')\n// -> 'file.aGFzaC1.[chunkhash]'\n\n// example-2\n// If the second argument is null, then it will generate hash from the\n// value of the third argument\nr('file.[hash:7].js', null, '1234567')\n// -> 'file.fcea920.js'\n```\n\n## replace(hashName)(template, replacer, content)\n\n- **hashName** `String`\n- **template** `String`\n  - **hashType** `String=md5` defaults to `'md5'`\n  - **hashName** `String` if the value of `template.hashName` and `hashName` not matches, the template will not be substituted.\n  - **digestType** `String=hex` defaults to `'hex'`\n  - **maxLength** `Number=Number.POSITIVE_INFINITY` maximum length of the hash. If unset, there will no limit.\n\nThe `template` has the following structure:\n\n```js\n'[hash]'\n'[hashName:maxLength]'\n'[hashType:hashName:digestType]'\n'[hashType:hashName:digestType:maxLength]'\n```\n\nAnd example-2 is equivalent to:\n\n```js\nr('file.[md5:hash:hex:7].js', null, '1234567')\n```\n\n- **replacer** `String=|function(match, hashType, digestType, length)=`\n\n```js\nconst r = replace('contenthash')\nconst filename =\n  r('file.[contenthash:7].js', null, fileContent)\n```\n\n- **content** `String=|Buffer=` If `replacer` is unset, it will try to digest the `content` to get the crypted hash.\n\n## License\n\nMIT\n","maintainers":[{"name":"kael","email":"i@kael.me"}],"time":{"modified":"2022-05-04T18:11:47.758Z","created":"2017-08-31T13:11:03.447Z","0.0.0":"2017-08-31T13:11:03.447Z","1.0.0":"2017-08-31T15:18:46.031Z","1.0.1":"2017-08-31T15:50:36.913Z","1.0.2":"2017-08-31T16:27:50.430Z","1.0.3":"2017-08-31T16:55:35.856Z","1.0.4":"2017-09-04T05:28:59.303Z","1.0.5":"2017-09-04T05:30:41.749Z"},"license":"MIT","readmeFilename":"README.md","description":"Substitute a webpack-style hash template string. [hash:7]->abcdefg","homepage":"https://github.com/kaelzhang/node-hash-replace#readme","keywords":["hash-replace","replace","hash","webpack","digest","contenthash","chunkhash","hash"],"repository":{"type":"git","url":"git://github.com/kaelzhang/node-hash-replace.git"},"author":{"name":"kaelzhang"},"bugs":{"url":"https://github.com/kaelzhang/node-hash-replace/issues"}}