{"name":"unicode-substring","version":"1.0.0","description":"Unicode-aware substring","main":"index.js","scripts":{"test":"nyc mocha"},"repository":{"type":"git","url":"git+https://github.com/lautis/unicode-substring.git"},"keywords":["unicode","substring"],"author":{"name":"Ville Lautanala","email":"lautis@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/lautis/unicode-substring/issues"},"homepage":"https://github.com/lautis/unicode-substring","devDependencies":{"mocha":"^3.4.2","nyc":"^11.0.2"},"dependencies":{},"gitHead":"088e12b6197e1fd13f227a6b86b41044b7fe5f75","_id":"unicode-substring@1.0.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"lautis","email":"lautis@gmail.com"},"dist":{"integrity":"sha512-2acGIOTaqS/GWocwKdyL1Vk9MHglCss1mR0CL2o/YJTwKrAt6JbTrw4X187VkSDmFcpJ8n2i3/+gJSYEdvXJMg==","shasum":"659fb839078e7bee84b86c27210ac4db215bf885","tarball":"http://registry-npm.ywwl.com/unicode-substring/download/unicode-substring-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHSvDR+7F5Qk3y/4oFjW2Z67918a3Sl69XLC26tvlCv8AiAMXyY3ngbFwFcwkv+QCq1gLQR3E4dR9J+2OptTh5bLjA=="}],"size":2767,"noattachment":false,"key":"/unicode-substring/-/unicode-substring-1.0.0.tgz"},"maintainers":[{"name":"lautis","email":"lautis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unicode-substring-1.0.0.tgz_1499798472147_0.31700639543123543"},"directories":{},"readme":"# unicode-substring [![Build Status](https://travis-ci.org/lautis/unicode-substring.svg?branch=master)](https://travis-ci.org/lautis/unicode-substring)\n\nUnicode-aware substring for JavaScript. Surrogate pairs are counted as a single character.\n\n## What?\n\nCharacters in JavaScript strings are exposed as 16-bit code points, also known as UCS-2 encoding. This usually good enough, but since there are more than 2^16 characters in Unicode, 16 bits is not enough to represent all characters. To overcome this limitation, characters with scalar value over `0x10FFFF` need to be encoded as surrogate pairs. This encoding is known as UTF-16.\n\nThe purpose of this library is to treat surrogate pairs as one character when extracting substrings from a string. This might be preferable if indices are returned from an Unicode-compatible environment.\n\n## Usage\n\n```javascript\n\nvar unicodeSubstring = require('unicode-substring')\n// unicodeSubstring(string, start, end)\nunicodeSubstring(\"💥Emoji Rule💥\", 0, 6)\n// => \"💥Emoji\"\n```\n\nThe `start` and `end` parameters behave similarly as [String.prototype.substring](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/substring).\n","publish_time":1499798473154,"_cnpm_publish_time":1499798473154,"dist-tags":{"latest":"1.0.0"}}