{"_id":"string-escape","_rev":"4097104","name":"string-escape","description":"A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.","dist-tags":{"latest":"0.3.0"},"maintainers":[{"name":"mathias","email":""}],"time":{"modified":"2025-12-08T22:54:22.000Z","created":"2013-06-05T10:00:16.791Z","0.3.0":"2013-07-30T19:59:11.469Z","0.2.3":"2013-07-26T15:02:11.732Z","0.2.2":"2013-06-28T18:38:47.877Z","0.2.1":"2013-06-28T17:20:25.089Z","0.2.0":"2013-06-28T14:12:36.515Z","0.1.6":"2013-06-17T12:24:37.747Z","0.1.5":"2013-06-06T08:02:58.108Z","0.1.4":"2013-06-05T21:30:39.303Z","0.1.3":"2013-06-05T20:53:13.027Z","0.1.2":"2013-06-05T20:06:35.228Z","0.1.1":"2013-06-05T11:25:09.846Z","0.1.0":"2013-06-05T10:00:16.791Z"},"users":{},"author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"repository":{"type":"git","url":"https://github.com/mathiasbynens/jsesc.git"},"versions":{"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"],"readmeFilename":"README.md","_id":"string-escape@0.3.0","dist":{"shasum":"857529624389719c2152b981719339b98c7f53e5","size":3750,"noattachment":false,"key":"/string-escape/-/string-escape-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.3.0.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"directories":{},"publish_time":1375214351469,"_hasShrinkwrap":false,"_cnpm_publish_time":1375214351469,"_cnpmcore_publish_time":"2021-12-16T23:35:03.235Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.2.3","dist":{"shasum":"124c99ba65474063248a754436b70cfd329e6b23","size":7616,"noattachment":false,"key":"/string-escape/-/string-escape-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.2.3.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1374850931732,"_hasShrinkwrap":false,"_cnpm_publish_time":1374850931732,"_cnpmcore_publish_time":"2021-12-16T23:35:03.418Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.2.2","dist":{"shasum":"ff196d720c1d6c5ef04c8168b1a2519f04a59c95","size":10996,"noattachment":false,"key":"/string-escape/-/string-escape-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.2.2.tgz"},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1372444727877,"_hasShrinkwrap":false,"_cnpm_publish_time":1372444727877,"_cnpmcore_publish_time":"2021-12-16T23:35:03.594Z"},"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"},"_id":"string-escape@0.2.1","dist":{"shasum":"3f9c4d134dcfac9770873737fa329395845de977","size":8481,"noattachment":false,"key":"/string-escape/-/string-escape-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.2.1.tgz"},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1372440025089,"_hasShrinkwrap":false,"_cnpm_publish_time":1372440025089,"_cnpmcore_publish_time":"2021-12-16T23:35:03.777Z"},"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"},"_id":"string-escape@0.2.0","dist":{"shasum":"8a042e09fcdc5c50df276c5a02205daf6aeb2061","size":8421,"noattachment":false,"key":"/string-escape/-/string-escape-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.2.0.tgz"},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1372428756515,"_hasShrinkwrap":false,"_cnpm_publish_time":1372428756515,"_cnpmcore_publish_time":"2021-12-16T23:35:04.027Z"},"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"},"_id":"string-escape@0.1.6","dist":{"shasum":"4ca1fae8f7e42a4002ebb7ff0d9a4ac0943b194d","size":8159,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.6.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1371471877747,"_hasShrinkwrap":false,"_cnpm_publish_time":1371471877747,"_cnpmcore_publish_time":"2021-12-16T23:35:04.232Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.1.5","dist":{"shasum":"b3fb9b4d583dcfa26859171996de4142ac8fcb48","size":9940,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.5.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1370505778108,"_hasShrinkwrap":false,"_cnpm_publish_time":1370505778108,"_cnpmcore_publish_time":"2021-12-16T23:35:04.444Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.1.4","dist":{"shasum":"862e5e05d76c49e5ffe739aef84ed8d569a6035a","size":9939,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.4.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1370467839303,"_hasShrinkwrap":false,"_cnpm_publish_time":1370467839303,"_cnpmcore_publish_time":"2021-12-16T23:35:04.628Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.1.3","dist":{"shasum":"f23a9754932cdf4e27db938eb36877f14806abee","size":9943,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.3.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1370465593027,"_hasShrinkwrap":false,"_cnpm_publish_time":1370465593027,"_cnpmcore_publish_time":"2021-12-16T23:35:04.837Z"},"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"},"_id":"string-escape@0.1.2","dist":{"shasum":"207796292828ddc5bbd60636e2e4974a19ae23e6","size":8262,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.2.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1370462795228,"_hasShrinkwrap":false,"_cnpm_publish_time":1370462795228,"_cnpmcore_publish_time":"2021-12-16T23:35:05.060Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.1.1","dist":{"shasum":"41692b4f0d354b0a1a9413768f81c0e4e93d6e05","size":9963,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.1.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1370431509846,"_hasShrinkwrap":false,"_cnpm_publish_time":1370431509846,"_cnpmcore_publish_time":"2021-12-16T23:35:05.312Z"},"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"},"readmeFilename":"README.md","_id":"string-escape@0.1.0","dist":{"shasum":"570c9c25f6805681f68afa804970c59792c48fe9","size":3497,"noattachment":false,"key":"/string-escape/-/string-escape-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-escape/download/string-escape-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":""}],"deprecated":"Package has been deprecated in favor of `jsesc`. Please `npm install jsesc` instead.","publish_time":1370426416791,"_hasShrinkwrap":false,"_cnpm_publish_time":1370426416791,"_cnpmcore_publish_time":"2021-12-16T23:35:05.537Z"}},"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","_attachments":{},"readmeFilename":"README.md","homepage":"http://mths.be/jsesc","bugs":{"url":"https://github.com/mathiasbynens/jsesc/issues"}}