{"_id":"string-escape","_rev":"49-f2797352558e04c8a5f7fcc6de850b71","name":"string-escape","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"string-escape","version":"0.1.0","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.36","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(string, options)`\n\nThis function takes a string and returns an escaped version of the string where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes).\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","readmeFilename":"README.md","_id":"string-escape@0.1.0","dist":{"shasum":"570c9c25f6805681f68afa804970c59792c48fe9","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.0.tgz","integrity":"sha512-/BWs3pOzoQ4YyN/pAJSGp3ouOSj/eB66UAz6hHnVJSWsycgisardbZKaCXgkYgxWKqBEdY69kW1d6KhdaeU+tw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAa+av46ekU/5oRy6PGA+AjHCX0/5V2N9Vkl1HRiO7/dAiBM721UwE1lv/etsbZ+yG0C4MbwbeuJAYMGb+f4W8yRJA=="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.1.1":{"name":"string-escape","version":"0.1.1","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.36","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(string, options)`\n\nThis function takes a string and returns an escaped version of the string where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes).\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","readmeFilename":"README.md","_id":"string-escape@0.1.1","dist":{"shasum":"41692b4f0d354b0a1a9413768f81c0e4e93d6e05","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.1.tgz","integrity":"sha512-6oVjNJqrUQ6Z9oloTaCMoMS8J+2E2ZhQJLhOPU7tkinJ02K3tdDxTwmBWe83xMZ+0IhEo2AqY4X5klgR1yRzrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFLEKwA8q92Gjgn0XfFHvTv/IN3TLYuDPxN19pFLHTRtAiEAr0u2MWGCQkxOGVO9uLMPs4Kkwg8s+c6Mg+50iFS25Rs="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.1.2":{"name":"string-escape","version":"0.1.2","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.36","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"ERROR: No README data found!","_id":"string-escape@0.1.2","dist":{"shasum":"207796292828ddc5bbd60636e2e4974a19ae23e6","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.2.tgz","integrity":"sha512-vqPLAhYwE7jDkF6o0d9BJwmeE9y86YgyW9awjHMs+F0d2Bq6roDSIpk1paNow/oiogOi+kHxUQHvd35/GmEqqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo4zdJzlOfz/bPUtEoaWQpfPdw4tPpDP54xEqbHluuZAiEAxokuonhICcCI1oWcZoiKof5R1a+wPpTd3yFrlsy72QY="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.1.3":{"name":"string-escape","version":"0.1.3","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.36","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install string-escape\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install mathiasbynens/javascript-string-escape\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(string, options)`\n\nThis function takes a string and returns an escaped version of the string where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes).\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n#### `escapeEverything`\n\nThe `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.\n\n```js\nstringEscape('lolwat\"foo\\'bar', {\n  'escapeEverything': true\n});\n// → '\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\\\'\\\\x62\\\\x61\\\\x72'\n// → \"\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\'\\\\x62\\\\x61\\\\x72\"\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","readmeFilename":"README.md","_id":"string-escape@0.1.3","dist":{"shasum":"f23a9754932cdf4e27db938eb36877f14806abee","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.3.tgz","integrity":"sha512-bGqQM1N5cJz7KlRAQuGXt5YOBnvT5lmIWhCArt7dL9TwUWu4RaSaGEzxjOvEbeOqeP6y9iW5Wgq8MsfPGMHv3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRAsu4sRPaNIAIig2e3a6SH24HWIQJRTZeTEIcJYgkhAiB8aTA7mHQZP0V4k9L8SKr68qCJ3tZ5FI3ALlxGuUpXtg=="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.1.4":{"name":"string-escape","version":"0.1.4","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.36","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install string-escape\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install mathiasbynens/javascript-string-escape\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(string, options)`\n\nThis function takes a string and returns an escaped version of the string where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes).\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n#### `escapeEverything`\n\nThe `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.\n\n```js\nstringEscape('lolwat\"foo\\'bar', {\n  'escapeEverything': true\n});\n// → '\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\\\'\\\\x62\\\\x61\\\\x72'\n// → \"\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\'\\\\x62\\\\x61\\\\x72\"\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","readmeFilename":"README.md","_id":"string-escape@0.1.4","dist":{"shasum":"862e5e05d76c49e5ffe739aef84ed8d569a6035a","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.4.tgz","integrity":"sha512-T236DSvUx3HM51bvHQN5Fa8Gzp9vZQJon1hOQ7Sp3sHrg6Pv9BK46U+/rZQ/wn6t6qu6IFyPrNR8lwe3yURpQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVZ3Wbtec5+GqplA4ga3tHmZWNERmkSkG1tnwTStkKLAIhAI5KsUF+1COGLWa/bqRN/IjoH2JnDQgT71eAfgRtm5VD"}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.1.5":{"name":"string-escape","version":"0.1.5","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.36","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install string-escape\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install mathiasbynens/javascript-string-escape\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(string, options)`\n\nThis function takes a string and returns an escaped version of the string where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes).\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n#### `escapeEverything`\n\nThe `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.\n\n```js\nstringEscape('lolwat\"foo\\'bar', {\n  'escapeEverything': true\n});\n// → '\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\\\'\\\\x62\\\\x61\\\\x72'\n// → \"\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\'\\\\x62\\\\x61\\\\x72\"\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","readmeFilename":"README.md","_id":"string-escape@0.1.5","dist":{"shasum":"b3fb9b4d583dcfa26859171996de4142ac8fcb48","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.5.tgz","integrity":"sha512-Y6jwBWjv48sx7s5qmMX0VctyAfJkkV7XaPBvqodHd/bKBJb2bHQOaXxt9BR5KDwkRoYwMEvogFp8EbwFc0lQYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwNIsOGn299ZM6Z+DnZrHiYkiu082Bn3dDNjPEaLt1tQIhAKFtJkusfwst/yWztU3bk7kg8F2BXW09sL0UNotgjIlc"}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.1.6":{"name":"string-escape","version":"0.1.6","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.37","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"ERROR: No README data found!","_id":"string-escape@0.1.6","dist":{"shasum":"4ca1fae8f7e42a4002ebb7ff0d9a4ac0943b194d","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.1.6.tgz","integrity":"sha512-oYNCPyko6WYD0SR7fSBCnhGNjh2Hypge8tLD6+9V8qn8S7Z+5RH9WJuhtPeyrjlcoZTZYwkxqjTn7VUXDbQ18Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmiuA6GSKrjUFuvX5h9xb8gMYjHaXNDoMKwPqdaSyGkgIhAIAJRL+5qnb/rKmLITct0ukvRechBc5k3tUu2y9+4CdB"}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.2.0":{"name":"string-escape","version":"0.2.0","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.37","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"ERROR: No README data found!","_id":"string-escape@0.2.0","dist":{"shasum":"8a042e09fcdc5c50df276c5a02205daf6aeb2061","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.2.0.tgz","integrity":"sha512-PXnj4ktqLjQ1BM3UiB0Y5oNcaKaoWOFAcDv0ONggXYPfuyiXRnrgqIl5lqBcT17Xzyfu7Im369q8uzp9c6nY5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdK8fnTD0yZUTI/rb98OZcC0BKObPKFylJaS0r0jdh7gIhAIoRvNXvuM9joaci6THUBSR3jmGw5sSi/nYnin/WDahe"}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.2.1":{"name":"string-escape","version":"0.2.1","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.37","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"ERROR: No README data found!","_id":"string-escape@0.2.1","dist":{"shasum":"3f9c4d134dcfac9770873737fa329395845de977","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.2.1.tgz","integrity":"sha512-yTZCF2FjDjSxPDOnJv5d2TxbXzptCTftqBStXmWWiO3wYnrVLblSVDF3+nheJDVIAQnWrw9853VfUCLZhT6kag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOlGYyM93a0gSfT/IB3v9acfaxKWv0VVIrBbol+m5SqAIgf4kXSVZ6gIHAFarA6q5RA1UQRs570GPpBUpKv7yTciU="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.2.2":{"name":"string-escape","version":"0.2.2","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.37","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output. [Here’s an online demo.](http://mothereff.in/js-escapes)\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install string-escape\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install mathiasbynens/javascript-string-escape\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Narwhal](http://narwhaljs.org/):\n\n```js\nvar stringEscape = require('string-escape').stringEscape;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(value, options)`\n\nThis function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings:\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nInstead of a string, the `value` can also be a flat object containing only string values. In that case, `stringEscape` will return a stringified version of the object where any characters that are not printable ASCII symbols are escaped in the same way.\n\n```js\nstringEscape({\n  'Ich ♥ Bücher': 'foo 𝌆 bar'\n});\n// → '{\\'Ich \\\\u2665 B\\\\xFCcher\\':\\'foo \\\\uD834\\\\uDF06 bar\\'}'\n```\n\nInstead of a string or an object, the `value` can also be a flat array containing only string values. In that case, `stringEscape` will return a stringified version of the array where any characters that are not printable ASCII symbols are escaped in the same way.\n\n```js\nstringEscape([\n  'Ich ♥ Bücher': 'foo 𝌆 bar'\n]);\n// → '[\\'Ich \\\\u2665 B\\\\xFCcher\\',\\'foo \\\\uD834\\\\uDF06 bar\\']'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\nThis setting also affects the output for objects:\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'quotes': 'double'\n});\n// → '{\"Ich \\\\u2665 B\\\\xFCcher\":\"foo \\\\uD834\\\\uDF06 bar\"}'\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n#### `escapeEverything`\n\nThe `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.\n\n```js\nstringEscape('lolwat\"foo\\'bar', {\n  'escapeEverything': true\n});\n// → '\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\\\'\\\\x62\\\\x61\\\\x72'\n// → \"\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\'\\\\x62\\\\x61\\\\x72\"\n```\n\nThis setting also affects the output for arrays and objects:\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'escapeEverything': true\n});\n// → '{\\'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72\\':\\'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72\\'}'\n// → \"{'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72':'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72'}\"\n\nstringEscape([ 'Ich ♥ Bücher': 'foo 𝌆 bar' ], {\n  'escapeEverything': true\n});\n// → '[\\'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72\\',\\'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72\\']'\n```\n\n#### `compact`\n\nThe `compact` option takes a boolean value (`true` or `false`), and defaults to `true` (enabled). When enabled, the output for arrays and objects will be as compact as possible; it won’t be formatted nicely.\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': true // this is the default\n});\n// → '{\\'Ich \\u2665 B\\xFCcher\\':\\'foo \\uD834\\uDF06 bar\\'}'\n\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false\n});\n// → '{\\n\\t\\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\nstringEscape(['Ich ♥ Bücher', 'foo 𝌆 bar'], {\n  'compact': false\n});\n// → '[\\n\\t\\'Ich \\u2665 B\\xFCcher\\',\\n\\t\\'foo \\uD834\\uDF06 bar\\'\\n]'\n```\n\nThis setting has no effect on the output for strings.\n\n#### `indent`\n\nThe `indent` option takes a string value, and defaults to `'\\t'`. When the `compact` setting is enabled (`true`), the value of the `indent` option is used to format the output for objects.\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false,\n  'indent': '\\t' // this is the default\n});\n// → '{\\n\\t\\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false,\n  'indent': '  '\n});\n// → '{\\n  \\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n```\n\nThis setting has no effect on the output for strings.\n\n#### `json`\n\nThe `json` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will always be valid JSON. [Hexadecimal character escape sequences](http://mathiasbynens.be/notes/javascript-escapes#hexadecimal) and the `\\b` or `\\0` escape sequences will not be used. Setting `json: true` implies `quotes: 'double', wrap: true`.\n\n```js\nstringEscape('foo\\x00bar\\xFF\\uFFFDbaz', {\n  'json': true\n});\n// → '\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"'\n\nstringEscape({ 'foo\\x00bar\\xFF\\uFFFDbaz': 'foo\\x00bar\\xFF\\uFFFDbaz' }, {\n  'json': true\n});\n// → '{\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\":\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"}'\n\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/javascript-string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","readmeFilename":"README.md","_id":"string-escape@0.2.2","dist":{"shasum":"ff196d720c1d6c5ef04c8168b1a2519f04a59c95","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.2.2.tgz","integrity":"sha512-a/X722W3X99qFY8ID2yPT10rK+tNhSTSelLh9eCoY7KYo10vtuI90bx/j/UW8p3ZOATBFzLUmass2DcSfsCu3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1rGLraGz2P4JXDrO8EzwSIwK8TsbgE5JtRDvH6YdqsAiEAhnX+T3OpGYD4LLVo2gSP0FiGLlmEi0VGFXjbwbXO8Yw="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.2.3":{"name":"string-escape","version":"0.2.3","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/stringescape","main":"string-escape.js","bin":{"jsesc":"bin/jsesc"},"man":["man/jsesc.1"],"keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/javascript-string-escape.git"},"bugs":{"url":"https://github.com/mathiasbynens/javascript-string-escape/issues"},"files":["LICENSE-MIT.txt","string-escape.js","bin/","man/"],"directories":{"test":"tests"},"scripts":{"test":"node tests/tests.js"},"dependencies":{},"devDependencies":{"grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-template":"~0.1.0","istanbul":"~0.1.37","qunit-clib":"~1.3.0","qunitjs":"~1.11.0","regenerate":"~0.5.1","requirejs":"~2.1.6"},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output. [Here’s an online demo.](http://mothereff.in/js-escapes)\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install string-escape\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install mathiasbynens/javascript-string-escape\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Narwhal](http://narwhaljs.org/):\n\n```js\nvar stringEscape = require('string-escape').stringEscape;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(value, options)`\n\nThis function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings:\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nInstead of a string, the `value` can also be a flat object containing only string values. In that case, `stringEscape` will return a stringified version of the object where any characters that are not printable ASCII symbols are escaped in the same way.\n\n```js\nstringEscape({\n  'Ich ♥ Bücher': 'foo 𝌆 bar'\n});\n// → '{\\'Ich \\\\u2665 B\\\\xFCcher\\':\\'foo \\\\uD834\\\\uDF06 bar\\'}'\n```\n\nInstead of a string or an object, the `value` can also be a flat array containing only string values. In that case, `stringEscape` will return a stringified version of the array where any characters that are not printable ASCII symbols are escaped in the same way.\n\n```js\nstringEscape([\n  'Ich ♥ Bücher': 'foo 𝌆 bar'\n]);\n// → '[\\'Ich \\\\u2665 B\\\\xFCcher\\',\\'foo \\\\uD834\\\\uDF06 bar\\']'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\nThis setting also affects the output for arrays and objects:\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'quotes': 'double'\n});\n// → '{\"Ich \\\\u2665 B\\\\xFCcher\":\"foo \\\\uD834\\\\uDF06 bar\"}'\n\nstringEscape([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {\n  'quotes': 'double'\n});\n// → '[\"Ich \\\\u2665 B\\\\xFCcher\",\"foo \\\\uD834\\\\uDF06 bar\"]'\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n#### `escapeEverything`\n\nThe `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.\n\n```js\nstringEscape('lolwat\"foo\\'bar', {\n  'escapeEverything': true\n});\n// → '\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\\\'\\\\x62\\\\x61\\\\x72'\n// → \"\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\'\\\\x62\\\\x61\\\\x72\"\n```\n\nThis setting also affects the output for arrays and objects:\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'escapeEverything': true\n});\n// → '{\\'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72\\':\\'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72\\'}'\n// → \"{'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72':'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72'}\"\n\nstringEscape([ 'Ich ♥ Bücher': 'foo 𝌆 bar' ], {\n  'escapeEverything': true\n});\n// → '[\\'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72\\',\\'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72\\']'\n```\n\n#### `compact`\n\nThe `compact` option takes a boolean value (`true` or `false`), and defaults to `true` (enabled). When enabled, the output for arrays and objects will be as compact as possible; it won’t be formatted nicely.\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': true // this is the default\n});\n// → '{\\'Ich \\u2665 B\\xFCcher\\':\\'foo \\uD834\\uDF06 bar\\'}'\n\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false\n});\n// → '{\\n\\t\\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\nstringEscape([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {\n  'compact': false\n});\n// → '[\\n\\t\\'Ich \\u2665 B\\xFCcher\\',\\n\\t\\'foo \\uD834\\uDF06 bar\\'\\n]'\n```\n\nThis setting has no effect on the output for strings.\n\n#### `indent`\n\nThe `indent` option takes a string value, and defaults to `'\\t'`. When the `compact` setting is enabled (`true`), the value of the `indent` option is used to format the output for arrays and objects.\n\n```js\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false,\n  'indent': '\\t' // this is the default\n});\n// → '{\\n\\t\\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\nstringEscape({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false,\n  'indent': '  '\n});\n// → '{\\n  \\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\nstringEscape([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {\n  'compact': false,\n  'indent': '  '\n});\n// → '[\\n  \\'Ich \\u2665 B\\xFCcher\\',\\n\\  t\\'foo \\uD834\\uDF06 bar\\'\\n]'\n```\n\nThis setting has no effect on the output for strings.\n\n#### `json`\n\nThe `json` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will always be valid JSON. [Hexadecimal character escape sequences](http://mathiasbynens.be/notes/javascript-escapes#hexadecimal) and the `\\v` or `\\0` escape sequences will not be used. Setting `json: true` implies `quotes: 'double', wrap: true`.\n\n```js\nstringEscape('foo\\x00bar\\xFF\\uFFFDbaz', {\n  'json': true\n});\n// → '\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"'\n\nstringEscape({ 'foo\\x00bar\\xFF\\uFFFDbaz': 'foo\\x00bar\\xFF\\uFFFDbaz' }, {\n  'json': true\n});\n// → '{\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\":\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"}'\n\nstringEscape([ 'foo\\x00bar\\xFF\\uFFFDbaz', 'foo\\x00bar\\xFF\\uFFFDbaz' ], {\n  'json': true\n});\n// → '[\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\",\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"]'\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n### Using the `jsesc` binary\n\nTo use the `jsesc` binary in your shell, simply install javascript-string-escape globally using npm:\n\n```bash\nnpm install -g string-escape\n```\n\nAfter that you will be able to escape strings from the command line:\n\n```bash\n$ jsesc 'föo ♥ bår 𝌆 baz'\nf\\xF6o \\u2665 b\\xE5r \\uD834\\uDF06 baz\n```\n\nTo escape flat arrays containing only string values or flat objects containing only string values, use the `-o`/`--object` option:\n\n```bash\n$ jsesc '{ \"föo\": \"♥\", \"bår\": \"𝌆 baz\" }'\nf\\xF6o \\u2665 b\\xE5r \\uD834\\uDF06 baz\n```\n\nCreate a version of a JSON file where any non-ASCII symbols are escaped:\n\n```bash\n$ cat data-raw.json | jsesc --json --object > data-escaped.json\n```\n\nSee `jsesc --help` for the full list of options.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/javascript-string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is available under the [MIT](http://mths.be/mit) license.\n","readmeFilename":"README.md","_id":"string-escape@0.2.3","dist":{"shasum":"124c99ba65474063248a754436b70cfd329e6b23","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.2.3.tgz","integrity":"sha512-JsEXGFtoYpAobY17RMRNnSTIDKDWxI2AheRX/3zo8uI9hcBqhcrpNKg4YSQshd1oh8JnZNc/CLAQuws6TBbatg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCM+W2Ty6eArX64h/dYgwpHkPweOGvRWYpwzx1M+Z8pBQIhAI4AZ5zV13zy7GhrpAzCXRR4XObVY90L9V223yujuPS4"}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead."},"0.3.0":{"name":"string-escape","version":"0.3.0","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","homepage":"http://mths.be/jsesc","main":"string-escape.js","keywords":["string","escape","tool"],"licenses":[{"type":"MIT","url":"http://mths.be/mit"}],"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/jsesc.git"},"bugs":{"url":"https://github.com/mathiasbynens/jsesc/issues"},"files":["string-escape.js"],"readme":"# jsesc [![Build status](https://travis-ci.org/mathiasbynens/jsesc.png?branch=master)](https://travis-ci.org/mathiasbynens/jsesc) [![Dependency status](https://gemnasium.com/mathiasbynens/jsesc.png)](https://gemnasium.com/mathiasbynens/jsesc)\n\nThis is a JavaScript library for [escaping JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](http://mothereff.in/js-escapes)\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install jsesc\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install mathiasbynens/jsesc\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install jsesc\n```\n\nIn a browser:\n\n```html\n<script src=\"jsesc.js\"></script>\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS](http://ringojs.org/):\n\n```js\nvar jsesc = require('jsesc');\n```\n\nIn [Narwhal](http://narwhaljs.org/):\n\n```js\nvar jsesc = require('jsesc').jsesc;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('jsesc.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'jsesc': 'path/to/jsesc'\n    }\n  },\n  ['jsesc'],\n  function(jsesc) {\n    console.log(jsesc);\n  }\n);\n```\n\n## API\n\n### `jsesc(value, options)`\n\nThis function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings:\n\n```js\njsesc('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\njsesc('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nInstead of a string, the `value` can also be a regular expression, an array, or an object. In such cases, `jsesc` will return a stringified version of the value where any characters that are not printable ASCII symbols are escaped in the same way.\n\n```js\n// Escaping a regular expression\njsesc(/©𝌆/g);\n// → '/\\\\xA9\\\\uD834\\\\uDF06/g'\n\n// Escaping an array\njsesc([\n  'Ich ♥ Bücher', 'foo 𝌆 bar'\n]);\n// → '[\\'Ich \\\\u2665 B\\\\xFCcher\\',\\'foo \\\\uD834\\\\uDF06 bar\\']'\n\n// Escaping an object\njsesc({\n  'Ich ♥ Bücher': 'foo 𝌆 bar'\n});\n// → '{\\'Ich \\\\u2665 B\\\\xFCcher\\':\\'foo \\\\uD834\\\\uDF06 bar\\'}'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\njsesc('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\njsesc('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\njsesc('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\nThis setting also affects the output for arrays and objects:\n\n```js\njsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'quotes': 'double'\n});\n// → '{\"Ich \\\\u2665 B\\\\xFCcher\":\"foo \\\\uD834\\\\uDF06 bar\"}'\n\njsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {\n  'quotes': 'double'\n});\n// → '[\"Ich \\\\u2665 B\\\\xFCcher\",\"foo \\\\uD834\\\\uDF06 bar\"]'\n```\n\n#### `wrap`\n\nThe `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.\n\n```js\njsesc('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single',\n  'wrap': true\n});\n// → '\\'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.\\''\n// → \"\\'Lorem ipsum \\\"dolor\\\" sit \\\\\\'amet\\\\\\' etc.\\'\"\n\njsesc('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double',\n  'wrap': true\n});\n// → '\"Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.\"'\n// → \"\\\"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit \\'amet\\' etc.\\\"\"\n```\n\n#### `escapeEverything`\n\nThe `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.\n\n```js\njsesc('lolwat\"foo\\'bar', {\n  'escapeEverything': true\n});\n// → '\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\\\'\\\\x62\\\\x61\\\\x72'\n// → \"\\\\x6C\\\\x6F\\\\x6C\\\\x77\\\\x61\\\\x74\\\\\\\"\\\\x66\\\\x6F\\\\x6F\\\\'\\\\x62\\\\x61\\\\x72\"\n```\n\nThis setting also affects the output for arrays and objects:\n\n```js\njsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'escapeEverything': true\n});\n// → '{\\'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72\\':\\'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72\\'}'\n// → \"{'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72':'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72'}\"\n\njsesc([ 'Ich ♥ Bücher': 'foo 𝌆 bar' ], {\n  'escapeEverything': true\n});\n// → '[\\'\\x49\\x63\\x68\\x20\\u2665\\x20\\x42\\xFC\\x63\\x68\\x65\\x72\\',\\'\\x66\\x6F\\x6F\\x20\\uD834\\uDF06\\x20\\x62\\x61\\x72\\']'\n```\n\nThis setting has no effect on the output for regular expressions. Those only use escape sequences for non-printable ASCII symbols and non-ASCII symbols, regardless of the value of the `escapeEverything` setting.\n\n#### `compact`\n\nThe `compact` option takes a boolean value (`true` or `false`), and defaults to `true` (enabled). When enabled, the output for arrays and objects will be as compact as possible; it won’t be formatted nicely.\n\n```js\njsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': true // this is the default\n});\n// → '{\\'Ich \\u2665 B\\xFCcher\\':\\'foo \\uD834\\uDF06 bar\\'}'\n\njsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false\n});\n// → '{\\n\\t\\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\njsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {\n  'compact': false\n});\n// → '[\\n\\t\\'Ich \\u2665 B\\xFCcher\\',\\n\\t\\'foo \\uD834\\uDF06 bar\\'\\n]'\n```\n\nThis setting has no effect on the output for strings.\n\n#### `indent`\n\nThe `indent` option takes a string value, and defaults to `'\\t'`. When the `compact` setting is enabled (`true`), the value of the `indent` option is used to format the output for arrays and objects.\n\n```js\njsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false,\n  'indent': '\\t' // this is the default\n});\n// → '{\\n\\t\\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\njsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, {\n  'compact': false,\n  'indent': '  '\n});\n// → '{\\n  \\'Ich \\u2665 B\\xFCcher\\': \\'foo \\uD834\\uDF06 bar\\'\\n}'\n\njsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], {\n  'compact': false,\n  'indent': '  '\n});\n// → '[\\n  \\'Ich \\u2665 B\\xFCcher\\',\\n\\  t\\'foo \\uD834\\uDF06 bar\\'\\n]'\n```\n\nThis setting has no effect on the output for strings or regular expressions.\n\n#### `json`\n\nThe `json` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output is always valid JSON. [Hexadecimal character escape sequences](http://mathiasbynens.be/notes/javascript-escapes#hexadecimal) and [the `\\v` or `\\0` escape sequences](http://mathiasbynens.be/notes/javascript-escapes#single) will not be used. Setting `json: true` implies `quotes: 'double', wrap: true`.\n\n```js\njsesc('foo\\x00bar\\xFF\\uFFFDbaz', {\n  'json': true\n});\n// → '\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"'\n\njsesc({ 'foo\\x00bar\\xFF\\uFFFDbaz': 'foo\\x00bar\\xFF\\uFFFDbaz' }, {\n  'json': true\n});\n// → '{\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\":\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"}'\n\njsesc([ 'foo\\x00bar\\xFF\\uFFFDbaz', 'foo\\x00bar\\xFF\\uFFFDbaz' ], {\n  'json': true\n});\n// → '[\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\",\"foo\\\\u0000bar\\\\u00FF\\\\uFFFDbaz\"]'\n\n// Values that aren’t strings, regular expressions, arrays, or object literals\n// can’t be escaped, so they’ll just be preserved:\njsesc([ 'foo\\x00bar', [1, '©', { 'foo': true, 'qux': null }], 42 ], {\n  'json': true\n});\n// → '[\"foo\\\\u0000bar\",[1,\"\\\\u00A9\",{\"foo\":true,\"qux\":null}],42]'\n```\n\n**Note:** Using this option on objects or arrays that contain non-string values relies on `JSON.parse()`. For legacy environments like IE ≤ 7, use [a `JSON` polyfill](http://bestiejs.github.io/json3/).\n\n### `jsesc.version`\n\nA string representing the semantic version number.\n\n### Using the `jsesc` binary\n\nTo use the `jsesc` binary in your shell, simply install jsesc globally using npm:\n\n```bash\nnpm install -g jsesc\n```\n\nAfter that you will be able to escape strings from the command line:\n\n```bash\n$ jsesc 'föo ♥ bår 𝌆 baz'\nf\\xF6o \\u2665 b\\xE5r \\uD834\\uDF06 baz\n```\n\nTo escape arrays or objects containing string values, use the `-o`/`--object` option:\n\n```bash\n$ jsesc --object '{ \"föo\": \"♥\", \"bår\": \"𝌆 baz\" }'\n{'f\\xF6o':'\\u2665','b\\xE5r':'\\uD834\\uDF06 baz'}\n```\n\nTo prettify the output in such cases, use the `-p`/`--pretty` option:\n\n```bash\n$ jsesc --pretty '{ \"föo\": \"♥\", \"bår\": \"𝌆 baz\" }'\n{\n  'f\\xF6o': '\\u2665',\n  'b\\xE5r': '\\uD834\\uDF06 baz'\n}\n```\n\nFor valid JSON output, use the `-j`/`--json` option:\n\n```bash\n$ jsesc --json --pretty '{ \"föo\": \"♥\", \"bår\": \"𝌆 baz\" }'\n{\n  \"f\\u00F6o\": \"\\u2665\",\n  \"b\\u00E5r\": \"\\uD834\\uDF06 baz\"\n}\n```\n\nRead a local JSON file, escape any non-ASCII symbols, and save the result to a new file:\n\n```bash\n$ jsesc --json --object < data-raw.json > data-escaped.json\n```\n\nOr do the same with an online JSON file:\n\n```bash\n$ curl -sL \"http://git.io/aorKgQ\" | jsesc --json --object > data-escaped.json\n```\n\nSee `jsesc --help` for the full list of options.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n**Note:** Using the `json` option on objects or arrays that contain non-string values relies on `JSON.parse()`. For legacy environments like IE ≤ 7, use [a `JSON` polyfill](http://bestiejs.github.io/json3/).\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/jsesc/master/coverage/jsesc/jsesc.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is available under the [MIT](http://mths.be/mit) license.\n","readmeFilename":"README.md","_id":"string-escape@0.3.0","dist":{"shasum":"857529624389719c2152b981719339b98c7f53e5","tarball":"https://registry.npmjs.org/string-escape/-/string-escape-0.3.0.tgz","integrity":"sha512-AM292mtfvJCPzoKBbL3YQaZ+xwaWOlYfejTADVDfL0QM/cFEZ2LoU2M8XuEZkuRxqtv9ZTjfCj+OX+rlfFWeTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFbSPr8aKoab2ycQtqMFqmqwul+kUQwApBhMTF+xPKwAIhAKn+6pBu1Oi+ISvaPjVc+DNPkaZuhpz2MNur7C+GrZj2"}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}]}},"readme":"# JavaScript string escape [![Build status](https://travis-ci.org/mathiasbynens/javascript-string-escape.png?branch=master)](https://travis-ci.org/mathiasbynens/javascript-string-escape) [![Dependency status](https://gemnasium.com/mathiasbynens/javascript-string-escape.png)](https://gemnasium.com/mathiasbynens/javascript-string-escape)\n\nThis is a JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.\n\nFeel free to fork if you see possible improvements!\n\n## Installation\n\nIn a browser:\n\n```html\n<script src=\"string-escape.js\"></script>\n```\n\nVia [npm](http://npmjs.org/):\n\n```bash\nnpm install string-escape\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar stringEscape = require('string-escape');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('string-escape.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n  {\n    'paths': {\n      'string-escape': 'path/to/string-escape'\n    }\n  },\n  ['string-escape'],\n  function(stringEscape) {\n    console.log(stringEscape);\n  }\n);\n```\n\n## API\n\n### `stringEscape(string, options)`\n\nThis function takes a string and returns an escaped version of the string where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes).\n\n```js\nstringEscape('Ich ♥ Bücher');\n// → 'Ich \\\\u2665 B\\\\xFCcher'\n\nstringEscape('foo 𝌆 bar');\n// → 'foo \\\\uD834\\\\uDF06 bar'\n```\n\nThe optional `options` argument accepts an object with the following options:\n\n#### `quotes`\n\nThe default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input string will be escaped as `\\'`, so that the output can be used in a string literal wrapped in single quotes.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.');\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'single'\n});\n// → 'Lorem ipsum \"dolor\" sit \\\\\\'amet\\\\\\' etc.'\n// → \"Lorem ipsum \\\"dolor\\\" sit \\\\'amet\\\\' etc.\"\n```\n\nIf you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`.\n\n```js\nstringEscape('Lorem ipsum \"dolor\" sit \\'amet\\' etc.', {\n  'quotes': 'double'\n});\n// → 'Lorem ipsum \\\\\"dolor\\\\\" sit \\'amet\\' etc.'\n// → \"Lorem ipsum \\\\\\\"dolor\\\\\\\" sit 'amet' etc.\"\n```\n\n### `stringEscape.version`\n\nA string representing the semantic version number.\n\n## Support\n\nThis library has been tested in at least Chrome 27-29, Firefox 3-22, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, and Rhino 1.7RC4.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.\n\nTo generate [the code coverage report](http://rawgithub.com/mathiasbynens/javascript-string-escape/master/coverage/string-escape/string-escape.js.html), use `grunt cover`.\n\n## Author\n\n| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## License\n\nThis library is dual licensed under the [MIT](http://mths.be/mit) and [GPL](http://mths.be/gpl) licenses.\n","maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"time":{"modified":"2022-06-27T01:00:45.559Z","created":"2013-06-05T10:00:13.854Z","0.1.0":"2013-06-05T10:00:16.791Z","0.1.1":"2013-06-05T11:25:09.846Z","0.1.2":"2013-06-05T20:06:35.228Z","0.1.3":"2013-06-05T20:53:13.027Z","0.1.4":"2013-06-05T21:30:39.303Z","0.1.5":"2013-06-06T08:02:58.108Z","0.1.6":"2013-06-17T12:24:37.747Z","0.2.0":"2013-06-28T14:12:36.515Z","0.2.1":"2013-06-28T17:20:25.089Z","0.2.2":"2013-06-28T18:38:47.877Z","0.2.3":"2013-07-26T15:02:11.732Z","0.3.0":"2013-07-30T19:59:11.469Z"},"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/jsesc.git"},"users":{"denji":true,"andrewyg":true}}