{"maintainers":[{"name":"anonymous","email":"github@sellside.com"}],"keywords":["escape","format","placeholder","placeholders","prettify","regex","replace","template","templates","token","tokens"],"dist-tags":{"latest":"0.2.0"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"description":"Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.","readme":"# preserve [![NPM version](https://badge.fury.io/js/preserve.svg)](http://badge.fury.io/js/preserve)\n\n> Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.\n\nUseful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier.\n\n**Example without `preserve`**\n\nLet's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `<ul><li><%= name %></li></ul>`:\n\njs-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template):\n\n```html\n<ul>\n  <li>\n    <%=n ame %>\n  </li>\n</ul>\n```\n\n**Example with `preserve`**\n\nCorrect.\n\n```html\n<ul>\n  <li><%= name %></li>\n</ul>\n```\n\nFor the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools.\n\n## Install\n## Install with [npm](npmjs.org)\n\n```bash\nnpm i preserve --save\n```\n\n## Run tests\n\n```bash\nnpm test\n```\n\n## API\n### [.before](index.js#L23)\n\nReplace tokens in `str` with a temporary, heuristic placeholder.\n\n* `str` **{String}**    \n* `returns` **{String}**: String with placeholders.  \n\n```js\ntokens.before('{a\\\\,b}');\n//=> '{__ID1__}'\n```\n\n### [.after](index.js#L44)\n\nReplace placeholders in `str` with original tokens.\n\n* `str` **{String}**: String with placeholders    \n* `returns` **{String}** `str`: String with original tokens.  \n\n```js\ntokens.after('{__ID1__}');\n//=> '{a\\\\,b}'\n```\n\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/preserve/issues)\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\nCopyright (c) 2015-2015, Jon Schlinkert.\nReleased under the MIT license\n\n***\n\n_This file was generated by [verb](https://github.com/assemble/verb) on January 10, 2015._\n\n[js-beautify]: https://github.com/beautify-web/js-beautify","repository":{"type":"git","url":"git://github.com/jonschlinkert/preserve.git"},"bugs":{"url":"https://github.com/jonschlinkert/preserve/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT"},"versions":{"0.1.0":{"name":"preserve","description":"Temporarily subsitute tokens in the given `string` with placeholders, then put them back after transforming the string.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/preserve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/preserve.git"},"bugs":{"url":"https://github.com/jonschlinkert/preserve/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"js-beautify":"^1.5.4","mocha":"*","verb":">= 0.2.6","verb-tag-jscomments":">= 0.2.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"_id":"preserve@0.1.0","_shasum":"a6bed49859eeab4238d186ed410f4008f9606747","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"anonymous","email":"github@sellside.com"},"maintainers":[{"name":"anonymous","email":"github@sellside.com"}],"dist":{"shasum":"a6bed49859eeab4238d186ed410f4008f9606747","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/preserve/-/preserve-0.1.0.tgz","integrity":"sha512-+3IuzqxHTyt5/RcI2TIhZfuMLBmU+/P/UJ3f7/OEMK9ACPkCXPsDL5b29jKWxBirsljiuOKNzK9151QyzQXXtQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKNb77S58YueYyeocAnICsROqqd5oL7gSTW9uW8Ex1ZAIhAKLg2r8SOP2vP7UgFPJu+r0rjmS8kU71gbh2m+4Gi4FP"}]}},"0.1.1":{"name":"preserve","description":"Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/preserve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/preserve.git"},"bugs":{"url":"https://github.com/jonschlinkert/preserve/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"js-beautify":"^1.5.4","mocha":"*","verb":">= 0.2.6","verb-tag-jscomments":">= 0.2.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"_id":"preserve@0.1.1","_shasum":"dea4d29644a0d9dceebbe0e93c3a763af49233f1","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"anonymous","email":"github@sellside.com"},"maintainers":[{"name":"anonymous","email":"github@sellside.com"}],"dist":{"shasum":"dea4d29644a0d9dceebbe0e93c3a763af49233f1","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/preserve/-/preserve-0.1.1.tgz","integrity":"sha512-SfS+4OZTYd43eedvsrEOTzWBWPe+J5UwPc8GZN9QbUFXP3gTAnm2Osdn3g7iY1ilOlhe3DmdTFwqIup9gft8wg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA+molci1KW/XQFfwazdWvQJsBVAfew58UUqR128xmcjAiAmxtfEQsi/LuxbpoiyT3ZJd5BWCH99Ye09VPNU/tr5mQ=="}]}},"0.1.2":{"name":"preserve","description":"Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/preserve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/preserve.git"},"bugs":{"url":"https://github.com/jonschlinkert/preserve/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"js-beautify":"^1.5.4","mocha":"*","verb":"^0.2.6","verb-tag-jscomments":"^0.2.0"},"keywords":["replace","placeholders","placeholder","token","tokens","regex","escape","template","format","prettify","markdown","templates","verb"],"_id":"preserve@0.1.2","_shasum":"792d62a5dc22a6fb374aeb1dc531f869d79587ed","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"anonymous","email":"github@sellside.com"},"maintainers":[{"name":"anonymous","email":"github@sellside.com"}],"dist":{"shasum":"792d62a5dc22a6fb374aeb1dc531f869d79587ed","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/preserve/-/preserve-0.1.2.tgz","integrity":"sha512-LVc5TykW8GqxnuiqtBkIgVCYUP+81viWnpBEQjphmTAlMrAf/Bd36B6qBGucizkzF/hy72D9gWwHJt05cwM5CQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUF0JWNb+ISP7x11Z/foXM6HN+MRwV8tDwcuM60KbXvgIhALR6OliXW6pKbXLlYgmuXgPWxlgAyhplwNrVRZZ6O8Am"}]}},"0.1.3":{"name":"preserve","description":"Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/preserve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/preserve.git"},"bugs":{"url":"https://github.com/jonschlinkert/preserve/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"js-beautify":"^1.5.4","mocha":"*","should":"^4.1.0","verb":"^0.2.6","verb-tag-jscomments":"^0.2.0"},"keywords":["escape","format","placeholder","placeholders","prettify","regex","replace","template","templates","token","tokens","verb"],"_id":"preserve@0.1.3","_shasum":"91fb3572a2df3ed45a93b8c986a0eab372b39723","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"anonymous","email":"github@sellside.com"},"maintainers":[{"name":"anonymous","email":"github@sellside.com"}],"dist":{"shasum":"91fb3572a2df3ed45a93b8c986a0eab372b39723","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/preserve/-/preserve-0.1.3.tgz","integrity":"sha512-2GDYk6hE4BTAkIRMrRDhhSWNOLRnCJ0RG6ORMIbjIxo17EIex+6U8g3bfksyu9FFTHCfpxP86cRnLdvi/lKxIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbAUdAE3vUX5bEnQYa1BZCUVCSV07aU6dwHVzUSh578QIhANo5YYv1T9fpuAnA2YoNkrYwE5/jvx4h5ArNOuPy4d1s"}]}},"0.2.0":{"name":"preserve","description":"Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/preserve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/preserve.git"},"bugs":{"url":"https://github.com/jonschlinkert/preserve/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT"},"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"benchmarked":"^0.1.3","chalk":"^0.5.1","js-beautify":"^1.5.4","mocha":"*","should":"*"},"keywords":["escape","format","placeholder","placeholders","prettify","regex","replace","template","templates","token","tokens"],"gitHead":"1bf405d35e4aea06a2ee83db2d34dc54abc0a1f9","_id":"preserve@0.2.0","_shasum":"815ed1f6ebc65926f865b310c0713bcb3315ce4b","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"anonymous","email":"github@sellside.com"},"maintainers":[{"name":"anonymous","email":"github@sellside.com"}],"dist":{"shasum":"815ed1f6ebc65926f865b310c0713bcb3315ce4b","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/preserve/-/preserve-0.2.0.tgz","integrity":"sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGvpwkttsJ3mBKl1Y3LMSfvPeEvxiu/yoXBHuIXOAuHpAiEA7zdJwA68PGIGFg9AgsE+Kw0wEs2FFSszRNz4knVSuN4="}]}}},"name":"preserve","time":{"modified":"2022-06-24T14:36:05.565Z","created":"2014-11-01T06:23:53.748Z","0.1.0":"2014-11-01T06:23:53.748Z","0.1.1":"2014-11-01T06:25:27.114Z","0.1.2":"2014-11-01T07:19:37.164Z","0.1.3":"2014-11-01T07:37:05.542Z","0.2.0":"2015-01-10T22:29:38.220Z"},"readmeFilename":"README.md","homepage":"https://github.com/jonschlinkert/preserve"}