{"_id":"string-replace-webpack-plugin","_rev":"445351","name":"string-replace-webpack-plugin","description":"Replace string tokens in the contents of a file.","dist-tags":{"latest":"0.1.3"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"time":{"modified":"2021-08-05T06:44:43.000Z","created":"2015-03-24T05:17:26.670Z","0.1.3":"2017-03-07T04:25:00.157Z","0.1.2":"2017-03-07T04:17:29.766Z","0.0.5":"2017-01-12T14:39:20.506Z","0.0.4":"2016-10-07T23:06:06.741Z","0.0.3":"2015-12-16T02:21:09.377Z","0.0.2":"2015-06-30T03:19:16.568Z","0.0.1":"2015-03-24T05:17:26.670Z"},"users":{"xueboren":true,"niubenjs":true,"martinmueller":true,"qddegtya":true,"noitidart":true},"author":{"name":"James Andersen @jandersen78"},"repository":{"type":"git","url":"git+ssh://git@github.com/jamesandersen/string-replace-webpack-plugin.git"},"versions":{"0.1.3":{"name":"string-replace-webpack-plugin","version":"0.1.3","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2 || >=2.2.0"},"dependencies":{"async":"~0.2.10","loader-utils":"~0.2.3","css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"^2.2.1"},"optionalDependencies":{"css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"git+ssh://git@github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"12aa074dab7af7e4be05c5718114e7548771e4a1","_id":"string-replace-webpack-plugin@0.1.3","_shasum":"73c657e759d66cfe80ae1e0cf091aa256d0e715c","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"73c657e759d66cfe80ae1e0cf091aa256d0e715c","size":4220,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.1.3.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/string-replace-webpack-plugin-0.1.3.tgz_1488860699924_0.9609620808623731"},"publish_time":1488860700157,"_cnpm_publish_time":1488860700157,"_hasShrinkwrap":false},"0.1.2":{"name":"string-replace-webpack-plugin","version":"0.1.2","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2 || >=2.2.0"},"dependencies":{"async":"~0.2.10","loader-utils":"~0.2.3","css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"^2.2.1"},"optionalDependencies":{"css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"git+ssh://git@github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"dd57b8c1d30e7eab27a685ce81409f8957f9b178","_id":"string-replace-webpack-plugin@0.1.2","_shasum":"3b379ac6d598a89097f50800799759e63bbd2390","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"3b379ac6d598a89097f50800799759e63bbd2390","size":4134,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.1.2.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/string-replace-webpack-plugin-0.1.2.tgz_1488860245641_0.3424856101628393"},"publish_time":1488860249766,"_cnpm_publish_time":1488860249766,"_hasShrinkwrap":false},"0.0.5":{"name":"string-replace-webpack-plugin","version":"0.0.5","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2 || >=2.2.0-rc.0"},"dependencies":{"async":"~0.2.10","loader-utils":"~0.2.3","css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"*"},"optionalDependencies":{"css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"git+ssh://git@github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"0602f3bf2e31556bd32ba717e2acc6e83de2a163","_id":"string-replace-webpack-plugin@0.0.5","_shasum":"64fd917b84066e8da9785c4d1729a8839af7aa89","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"64fd917b84066e8da9785c4d1729a8839af7aa89","size":4104,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.0.5.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/string-replace-webpack-plugin-0.0.5.tgz_1484231960264_0.007770254975184798"},"publish_time":1484231960506,"_cnpm_publish_time":1484231960506,"_hasShrinkwrap":false},"0.0.4":{"name":"string-replace-webpack-plugin","version":"0.0.4","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2"},"dependencies":{"async":"~0.2.10","loader-utils":"~0.2.3","css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"*"},"optionalDependencies":{"css-loader":"^0.9.1","file-loader":"^0.8.1","style-loader":"^0.8.3"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"git+ssh://git@github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"3d3e003bc9a69964378d483fb4a66d197c83cef8","_id":"string-replace-webpack-plugin@0.0.4","_shasum":"07a5848ce73d9e9bb336a77a7c86f27a7177c86f","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"07a5848ce73d9e9bb336a77a7c86f27a7177c86f","size":3991,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.0.4.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/string-replace-webpack-plugin-0.0.4.tgz_1475881565075_0.32467128592543304"},"publish_time":1475881566741,"_cnpm_publish_time":1475881566741,"_hasShrinkwrap":false},"0.0.3":{"name":"string-replace-webpack-plugin","version":"0.0.3","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2"},"dependencies":{"async":"~0.2.10","css-loader":"^0.9.1","file-loader":"^0.8.1","loader-utils":"~0.2.3","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"*"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"git+ssh://git@github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"a476aa763cbb9509f315e01c953b7955f1193733","_id":"string-replace-webpack-plugin@0.0.3","_shasum":"82c67448cea95ec002a1bfcfd2fb0195cd12bd24","_from":".","_npmVersion":"3.5.1","_nodeVersion":"4.1.2","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"82c67448cea95ec002a1bfcfd2fb0195cd12bd24","size":9243,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.0.3.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"publish_time":1450232469377,"_cnpm_publish_time":1450232469377,"_hasShrinkwrap":false},"0.0.2":{"name":"string-replace-webpack-plugin","version":"0.0.2","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2"},"dependencies":{"async":"~0.2.10","css-loader":"^0.9.1","file-loader":"^0.8.1","loader-utils":"~0.2.3","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"*"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"http://github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"1a365a2584cec0aa7aa722711d37f28d0b873e9e","_id":"string-replace-webpack-plugin@0.0.2","_shasum":"9554ddd8563c6bc7e9ba1c875fa54489e43db7fe","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.10.22","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"9554ddd8563c6bc7e9ba1c875fa54489e43db7fe","size":9243,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.0.2.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"publish_time":1435634356568,"_cnpm_publish_time":1435634356568,"_hasShrinkwrap":false},"0.0.1":{"name":"string-replace-webpack-plugin","version":"0.0.1","author":{"name":"James Andersen @jandersen78"},"description":"Replace string tokens in the contents of a file.","peerDependencies":{"webpack":"^1.4.2"},"dependencies":{"async":"~0.2.10","css-loader":"^0.9.1","file-loader":"^0.8.1","loader-utils":"~0.2.3","style-loader":"^0.8.3"},"devDependencies":{"mocha":"^2.2.1","webpack":"*"},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","repository":{"type":"git","url":"http://github.com/jamesandersen/string-replace-webpack-plugin.git"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"main":"index.js","directories":{"example":"example"},"scripts":{"test":"mocha test"},"keywords":["webpack","string","replace","plugin"],"license":"MIT","gitHead":"135fdea9b27782f05854adb26a58e03d1a046cd7","_id":"string-replace-webpack-plugin@0.0.1","_shasum":"2f15f7634d1020ce2a9bbea32406fba9e849b6f3","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.10.22","_npmUser":{"name":"jamesandersen","email":"james.j.andersen@gmail.com"},"dist":{"shasum":"2f15f7634d1020ce2a9bbea32406fba9e849b6f3","size":8731,"noattachment":false,"key":"/string-replace-webpack-plugin/-/string-replace-webpack-plugin-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-replace-webpack-plugin/download/string-replace-webpack-plugin-0.0.1.tgz"},"maintainers":[{"name":"jamesandersen","email":"james.j.andersen@gmail.com"}],"publish_time":1427174246670,"_cnpm_publish_time":1427174246670,"_hasShrinkwrap":false}},"readme":"# string replace plugin for webpack\n\n## Usage example\n\n``` javascript\nvar StringReplacePlugin = require(\"string-replace-webpack-plugin\");\nmodule.exports = {\n   module: {\n      loaders: [\n         // configure replacements for file patterns\n         { \n            test: /index.html$/,\n            loader: StringReplacePlugin.replace({\n                replacements: [\n                    {\n                        pattern: /<!-- @secret (\\w*?) -->/ig,\n                        replacement: function (match, p1, offset, string) {\n                            return secrets.web[p1];\n                        }\n                    }\n                ]})\n            }\n      ]\n   },\n   plugins: [\n      // an instance of the plugin must be present\n      new StringReplacePlugin()\n   ]\n}\n```\n\nThis allows for arbitrary strings to be replaced as part of the module build process.  The original intent is to replace API\nkeys in modules prior to deployment.\n\n## API\n\n``` javascript\nStringReplacePlugin.replace([nextLoaders: string], options, [prevLoaders: string])\n```\n\n* `nextLoaders` loaders to follow the replacement\n* `options`\n  * `replacements` disables the plugin\n    * `pattern` a regex to match against the file contents\n    * `replacement` an ECMAScript [string replacement function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter)\n* `prevLoaders` loaders to apply prior to the replacement\n\n## License\n\nMIT (http://www.opensource.org/licenses/mit-license.php)\n","_attachments":{},"homepage":"http://github.com/jamesandersen/string-replace-webpack-plugin","bugs":{"url":"https://github.com/jamesandersen/string-replace-webpack-plugin/issues"},"license":"MIT"}