{"_id":"replacements","_rev":"13-de90343f7f5a3c20a871671c406b4822","name":"replacements","description":"Transform a string with an array of replacement patterns.","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"replacements","description":"Run multiple regex or string find-and-replace transformations on a string in sequence, reducing the final string to the accumulated result of each transformation.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/replacements","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/replacements.git"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/replacements/blob/master/LICENSE-MIT"}],"keywords":["escape","expression","expressions","find","format","locate","match","matches","modify","pattern","patterns","re","regex","regexp","regular","replace","replaced","replacement","replacements","search","sluggifier","slugification","slugified","slugify","string","strings","structure","substitute","template","templates","tranformation","transform","un-escape","unescape","url","util","utils","utility"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*"},"_id":"replacements@0.1.0","_shasum":"5f0716c35223aa63a9752c692753d64b521b650d","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5f0716c35223aa63a9752c692753d64b521b650d","tarball":"https://registry.npmjs.org/replacements/-/replacements-0.1.0.tgz","integrity":"sha512-mfBqu/iYdPnP//rugnIa8BcOH2LcbonYUWB/iTV7RGuSQ8b5Rcy/kr6F3sCtADX02Y4Tkl+LJC9O3n+w/HFqGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7NCmBE0k18iEs3w8IAHccrzpvMU56cL/QAuhi7X4mXAIgVWRPtApg2XkPSHqTrQc+ZtK1ROeFYIXunEw5E8E7UPw="}]}},"0.1.1":{"name":"replacements","description":"Run multiple regex or string find-and-replace transformations on a string in sequence, reducing the final string to the accumulated result of all transformations.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/replacements","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/replacements.git"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/replacements/blob/master/LICENSE-MIT"}],"keywords":["escape","expression","expressions","find","format","locate","match","matches","modify","pattern","patterns","re","regex","regexp","regular","replace","replaced","replacement","replacements","search","sluggifier","slugification","slugified","slugify","string","strings","structure","substitute","template","templates","tranformation","transform","un-escape","unescape","url","util","utils","utility"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*"},"_id":"replacements@0.1.1","_shasum":"132e965146f8cc5357412533f9712b025dba6741","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"132e965146f8cc5357412533f9712b025dba6741","tarball":"https://registry.npmjs.org/replacements/-/replacements-0.1.1.tgz","integrity":"sha512-C3JygwHe1lipeNR547NHd5ILDT09MNkfsJSqvaSWDrkXV4GZE1UGp4UtOS1h2WHK7M0qN+u6x8wpIq4jc+XH9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPblmMXDTQDWRQYV7FQHqyTONCGaKPUsA7p+gv+PKQpQIhAJzQPLPA31vAp/b+1bmfLpeLvc1IcoQ4m6hLqyfkvlSM"}]}},"0.1.2":{"name":"replacements","description":"Run multiple regex or string find-and-replace transformations on a string in sequence, reducing the final string to the accumulated result of all transformations.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/replacements","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/replacements.git"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/replacements/blob/master/LICENSE-MIT"}],"keywords":["escape","expression","expressions","find","format","locate","match","matches","modify","pattern","patterns","re","regex","regexp","regular","replace","replaced","replacement","replacements","search","sluggifier","slugification","slugified","slugify","string","strings","structure","substitute","template","templates","tranformation","transform","un-escape","unescape","url","util","utils","utility"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*"},"_id":"replacements@0.1.2","_shasum":"d7f4e197104de5f6e359ca98ce1474fb9b2fc41f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"d7f4e197104de5f6e359ca98ce1474fb9b2fc41f","tarball":"https://registry.npmjs.org/replacements/-/replacements-0.1.2.tgz","integrity":"sha512-ymSy4CLrRrlzdGi5zrg8tgCfgOJVtVYGBOui7irXOW4gJokuiq/cLlRYEoaAidMe+FOLU+QqynXa3UNk2JI+uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWUtqS6dI4EMEqt6rkTauKVRZcF+PMY+iebY2jmA3x/AIhANtQCpcDgWPJxbF3g4ijO4PovoFVNHiS9GK7eA39ZEoe"}]}},"0.1.3":{"name":"replacements","description":"Run multiple regex or string find-and-replace transformations on a string in sequence, reducing the final string to the accumulated result of all transformations.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/replacements","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/replacements.git"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/replacements/blob/master/LICENSE-MIT"}],"keywords":["escape","expression","expressions","find","format","locate","match","matches","modify","pattern","patterns","re","regex","regexp","regular","replace","replaced","replacement","replacements","search","sluggifier","slugification","slugified","slugify","string","strings","structure","substitute","template","templates","tranformation","transform","un-escape","unescape","url","util","utils","utility"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*"},"_id":"replacements@0.1.3","_shasum":"a4151b04105857dc58982300b5f1b9f5ebe0c91d","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"a4151b04105857dc58982300b5f1b9f5ebe0c91d","tarball":"https://registry.npmjs.org/replacements/-/replacements-0.1.3.tgz","integrity":"sha512-8GO8Ap3O2hb2kEAx+aaUidAVUjiTqWtwxr805TjERKAVq8/sA86zw7oMn6iYWBJyhHsoGtdxcNXSfCeMumUP/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdLn3rDgnqpmOHYgakwymo+7VvepzeFzdt6/lwAdikqwIhAMLpSSCKhDZ/dlwhQ4od/0LLKCozlRPV2FDV68KWty7S"}]}},"0.2.0":{"name":"replacements","description":"Transform a string with an array of replacement patterns.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/replacements","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/replacements.git"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/replacements/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","should":"^5.2.0"},"keywords":["regex","regular expression","escape","expression","match","modify","pattern","replace","replacement","search","structure","substitute"],"gitHead":"547844fdeaad0104df77dea22111236de1eac354","_id":"replacements@0.2.0","_shasum":"854b539a312fe8d8b0120b9e95e712eb44cce24e","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"854b539a312fe8d8b0120b9e95e712eb44cce24e","tarball":"https://registry.npmjs.org/replacements/-/replacements-0.2.0.tgz","integrity":"sha512-tg2Il6p3wg8xMzLfS6NqrrSOc1k34xcqD40Mf1zfBXgXG9Z71kcHiOuaPBXRmPmIP4XcbylUJ/sJ54co8N0+Ig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNEJJP6SKMHBfMQmlPBY+TkVgXjMw9eG8RXz358dW5MgIgEtLT7n/eqoIvnrMPvluO+6kSDx9Da17l4pc6g5LDH7w="}]}},"0.2.1":{"name":"replacements","description":"Transform a string with an array of replacement patterns.","version":"0.2.1","homepage":"https://github.com/jonschlinkert/replacements","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/replacements.git"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["escape","expression","match","modify","pattern","regex","regular expression","replace","replacement","search","structure","substitute"],"verb":{"layout":"default","related":{"list":["easy-renamer"]},"plugins":["gulp-format-md"]},"gitHead":"9fd5647bbb2b858b81b286a78fe9768a522ccf8a","_id":"replacements@0.2.1","_shasum":"bff40a6949b5985c6809446457c2c2044c81b349","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"bff40a6949b5985c6809446457c2c2044c81b349","tarball":"https://registry.npmjs.org/replacements/-/replacements-0.2.1.tgz","integrity":"sha512-NrSrMYcWxJHQ7osDn3VEXc/N+dDknEIXxr5pqdSnufTdpDJ6MiIxQkqIxVIOjkjq649yXppb2ja7gsR6HPpr8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+foiMMgpioY0qZRsOzhNHYz5NgmJtXatoG6w/88lpRgIhAOcS+LM5hNb+/vIzP+DDUvjnJjh3ISHbESuRtN0oesVX"}]}}},"readme":"# replacements [![NPM version](https://img.shields.io/npm/v/replacements.svg)](https://www.npmjs.com/package/replacements) [![Build Status](https://img.shields.io/travis/jonschlinkert/replacements.svg)](https://travis-ci.org/jonschlinkert/replacements)\n\n> Transform a string with an array of replacement patterns.\n\n- [Install](#install)\n- [Usage](#usage)\n  * [object of replacement patterns](#object-of-replacement-patterns)\n  * [key-value replacement patterns](#key-value-replacement-patterns)\n  * [array of replacement patterns](#array-of-replacement-patterns)\n  * [functions as replacements](#functions-as-replacements)\n- [Related projects](#related-projects)\n- [Running tests](#running-tests)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb))_\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i replacements --save\n```\n\n## Usage\n\n```js\nvar replace = require('replacements');\n```\n\n### object of replacement patterns\n\n```js\nvar transformers = {\n  pattern: /a/g,\n  replacement: 'bbb'\n};\nconsole.log(replace('aaa', transformers));\n//=> 'bbbbbbbbb'\n```\n\n### key-value replacement patterns\n\nFor basic string transformations, you can pass the string to replace as the key, and the replacement as a value:\n\n```js\nvar transformers = {\n  'a': 'b'\n  'c': 'd'\n};\nconsole.log(replace('aaabbbccc', transformers));\n//=> 'bbbbbbddd'\n```\n\n_Note that only the first matching string will only be replaced using this format. If you need more flexibility, use the pattern-replacement regex syntax._.\n\n### array of replacement patterns\n\n```js\nvar transformers = [\n  {pattern: /a/g, replacement: 'bbb'},\n  {pattern: /b/g, replacement: 'ccc'},\n  {pattern: /c/g, replacement: 'ddd'},\n  {pattern: /d/g, replacement: 'eee'},\n  {pattern: /[e]+/g, replacement: '_DONE_'}\n];\nconsole.log(replace('aaa', transformers));\n//=> '__DONE__'\n```\n\n### functions as replacements\n\n```js\nvar transformers = {\n  pattern: /a+/g,\n  replacement: function(match) {\n    return match.split('').map(function(str, i) {\n      if (i === 0) {return 'b'; }\n      if (i === 1) {return str.toUpperCase();}\n      return str;\n    }).join('');\n  }\n};\nconsole.log(replace('aaa', transformers));\n//=> 'bAa'\n```\n\n## Related projects\n\n[easy-renamer](https://www.npmjs.com/package/easy-renamer): Easily rename files using custom rename functions that are automatically used against any filepaths that… [more](https://www.npmjs.com/package/easy-renamer) | [homepage](https://github.com/jonschlinkert/easy-renamer)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/replacements/issues/new).\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on December 20, 2015._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-26T11:21:33.181Z","created":"2014-07-05T21:55:39.801Z","0.1.0":"2014-07-05T21:55:39.801Z","0.1.1":"2014-07-05T22:40:29.596Z","0.1.2":"2014-07-08T05:42:26.733Z","0.1.3":"2014-07-08T05:43:26.532Z","0.2.0":"2015-03-13T13:07:24.133Z","0.2.1":"2015-12-20T14:53:34.361Z"},"homepage":"https://github.com/jonschlinkert/replacements","keywords":["escape","expression","match","modify","pattern","regex","regular expression","replace","replacement","search","structure","substitute"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/replacements.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/replacements/issues"},"readmeFilename":"README.md","license":"MIT"}