{"_id":"noncharacters","_rev":"11482","name":"noncharacters","description":"34 non-character code points (labeled <not a character>), that are set aside and guaranteed to never be used for a character. Perfect to use for placeholders or temporary replacements during string transformations.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T09:58:00.000Z","created":"2015-02-23T03:51:48.607Z","1.1.0":"2015-02-27T15:09:41.921Z","1.0.0":"2015-02-23T03:51:48.607Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/noncharacters.git"},"versions":{"1.1.0":{"name":"noncharacters","description":"34 non-character code points (labeled <not a character>), that are set aside and guaranteed to never be used for a character. Perfect to use for placeholders or temporary replacements during string transformations.","version":"1.1.0","homepage":"https://github.com/jonschlinkert/noncharacters","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/noncharacters.git"},"bugs":{"url":"https://github.com/jonschlinkert/noncharacters/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/noncharacters/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"keywords":[],"gitHead":"4267f2763b13c68b3994caa9d273f683915e1168","_id":"noncharacters@1.1.0","_shasum":"af33df30fd50ed3c53cd202258f25ada90b540d2","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"af33df30fd50ed3c53cd202258f25ada90b540d2","size":2226,"noattachment":false,"key":"/noncharacters/-/noncharacters-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/noncharacters/download/noncharacters-1.1.0.tgz"},"directories":{},"publish_time":1425049781921,"_cnpm_publish_time":1425049781921,"_hasShrinkwrap":false},"1.0.0":{"name":"noncharacters","description":"34 non-character code points (labeled <not a character>), that are set aside and guaranteed to never be used for a character. Perfect to use for placeholders or temporary replacements during string transformations.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/noncharacters","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/noncharacters.git"},"bugs":{"url":"https://github.com/jonschlinkert/noncharacters/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/noncharacters/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"keywords":[],"gitHead":"b9a324dda3d1619f8acd95f70d1d92824c8e891d","_id":"noncharacters@1.0.0","_shasum":"5ea76e26272b72aa8d14fec79db0da6a8247577c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5ea76e26272b72aa8d14fec79db0da6a8247577c","size":2127,"noattachment":false,"key":"/noncharacters/-/noncharacters-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/noncharacters/download/noncharacters-1.0.0.tgz"},"directories":{},"publish_time":1424663508607,"_cnpm_publish_time":1424663508607,"_hasShrinkwrap":false}},"readme":"# noncharacters [![NPM version](https://badge.fury.io/js/noncharacters.svg)](http://badge.fury.io/js/noncharacters)\n\n> 34 non-character code points (labeled <not a character>), that are set aside and guaranteed to never be used for a character. Perfect to use for placeholders or temporary replacements during string transformations.\n\nSee the wikipedia [article on non-characters][wiki]. Also, I used [regenerate](https://github.com/mathiasbynens/regenerate) from [mathiasbynens](https://github.com/mathiasbynens) to generate the range of characters. \n\n## Install with [npm](npmjs.org)\n\n```bash\nnpm i noncharacters --save\n```\n\n## Usage\n\n```js\nvar noncharacters = require('noncharacters');\n//=> ['\\uFFFF', '\\uFFFE', ...]\n```\n\n**Example**\n\nLet's say you need to transform a string but you need to temporarily replace some characters that might cause issues. \n\nCreate your own placeholders:\n\n```js\n// arbitrary characters we want to replace, \n// mapped to placeholder non-characters\nvar placeholders = {\n  '{': noncharacters[0],\n  '}': noncharacters[1]\n};\n\n// the string with characters to replace\nvar str = 'This is a template: {name}';\n\n// actually replace the characters\nObject.keys(placeholders).forEach(function(ch) {\n  str = str.replace(ch, placeholders[ch]);\n});\n//=> This is a template: \\uFFFFname\\uFFFE\n```\nNow you can do whatever you want to `str`. Then, to change back:\n\n```js\nObject.keys(placeholders).forEach(function(ch) {\n  str = str.replace(placeholders[ch], ch);\n});\n//=> This is a template: {name}\n```\n\n\n## Run tests\n\nInstall dev dependencies:\n\n```bash\nnpm i -d && npm test\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/noncharacters/issues)\n\n## Author\n\n**Jon Schlinkert**\n \n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n## License\nCopyright (c) 2015 Jon Schlinkert  \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on February 27, 2015._\n\n\n[wiki]: http://en.wikipedia.org/wiki/Universal_Character_Set_characters#Noncharacters\n","_attachments":{},"homepage":"https://github.com/jonschlinkert/noncharacters","bugs":{"url":"https://github.com/jonschlinkert/noncharacters/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/noncharacters/blob/master/LICENSE"}}