{"_id":"truncate-utf8-bytes","_rev":"142008","name":"truncate-utf8-bytes","description":"Truncate string to given length in bytes","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"carltonf","email":"xiongc05@gmail.com"},{"name":"parshap","email":""}],"time":{"modified":"2021-06-03T11:27:34.000Z","created":"2015-11-06T11:18:47.644Z","1.0.2":"2016-09-29T18:43:57.785Z","1.0.1":"2015-11-06T12:51:41.020Z","1.0.0":"2015-11-06T11:18:47.644Z"},"users":{"monolithed":true,"superscan":true},"author":{"name":"Carl Xiong","email":"xiongc05@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/parshap/truncate-utf8-bytes.git"},"versions":{"1.0.2":{"name":"truncate-utf8-bytes","version":"1.0.2","description":"Truncate string to given length in bytes","main":"index.js","browser":"browser.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/parshap/truncate-utf8-bytes.git"},"keywords":["truncate","utf8"],"author":{"name":"Carl Xiong","email":"xiongc05@gmail.com"},"license":"WTFPL","bugs":{"url":"https://github.com/parshap/truncate-utf8-bytes/issues"},"homepage":"https://github.com/parshap/truncate-utf8-bytes#readme","devDependencies":{"tape":"^4.2.2"},"dependencies":{"utf8-byte-length":"^1.0.1"},"contributors":[{"name":"Carl Xiong","email":"xiongc05@gmail.com"},{"name":"Parsha Pourkhomami","email":"parshap@gmail.com"}],"gitHead":"c8fcebc8be093c8bd8db1e7d75c09b9fce7e4708","_id":"truncate-utf8-bytes@1.0.2","_shasum":"405923909592d56f78a5818434b0b78489ca5f2b","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.6.0","_npmUser":{"name":"parshap","email":"parshap+npm@gmail.com"},"dist":{"shasum":"405923909592d56f78a5818434b0b78489ca5f2b","size":2234,"noattachment":false,"key":"/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/truncate-utf8-bytes/download/truncate-utf8-bytes-1.0.2.tgz"},"maintainers":[{"name":"carltonf","email":"xiongc05@gmail.com"},{"name":"parshap","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/truncate-utf8-bytes-1.0.2.tgz_1475174637574_0.12184767331928015"},"directories":{},"publish_time":1475174637785,"_cnpm_publish_time":1475174637785,"_hasShrinkwrap":false},"1.0.1":{"name":"truncate-utf8-bytes","version":"1.0.1","description":"Truncate string to given length in bytes","main":"index.js","browser":"browser.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/parshap/truncate-utf8-bytes.git"},"keywords":["truncate","utf8"],"author":{"name":"Carl Xiong","email":"xiongc05@gmail.com"},"license":"WTFPL","bugs":{"url":"https://github.com/parshap/truncate-utf8-bytes/issues"},"homepage":"https://github.com/parshap/truncate-utf8-bytes#readme","devDependencies":{"tape":"^4.2.2"},"dependencies":{"utf8-byte-length":"^1.0.1"},"contributors":[{"name":"Carl Xiong","email":"xiongc05@gmail.com"},{"name":"Parsha Pourkhomami","email":"parshap@gmail.com"}],"gitHead":"3528735219b2c17f5b01a444b23383752542f769","_id":"truncate-utf8-bytes@1.0.1","_shasum":"bafcbf814c5e44ec09168934eb236edf756dea2d","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"parshap","email":"parshap+npm@gmail.com"},"maintainers":[{"name":"carltonf","email":"xiongc05@gmail.com"},{"name":"parshap","email":""}],"dist":{"shasum":"bafcbf814c5e44ec09168934eb236edf756dea2d","size":49173,"noattachment":false,"key":"/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/truncate-utf8-bytes/download/truncate-utf8-bytes-1.0.1.tgz"},"directories":{},"publish_time":1446814301020,"_cnpm_publish_time":1446814301020,"_hasShrinkwrap":false},"1.0.0":{"name":"truncate-utf8-bytes","version":"1.0.0","description":"Truncate string to length in bytes","main":"index.js","browser":"browser.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/parshap/truncate-utf8-bytes.git"},"keywords":["truncate","utf8"],"author":{"name":"Carl Xiong","email":"xiongc05@gmail.com"},"license":"WTFPL","bugs":{"url":"https://github.com/parshap/truncate-utf8-bytes/issues"},"homepage":"https://github.com/parshap/truncate-utf8-bytes#readme","devDependencies":{"tape":"^4.2.2"},"dependencies":{"utf8-byte-length":"^1.0.1"},"contributors":[{"name":"Carl Xiong","email":"xiongc05@gmail.com"},{"name":"Parsha Pourkhomami","email":"parshap@gmail.com"}],"gitHead":"6cf4f21baf8e062db3cbb5b4d5f8a649e8a5c8ef","_id":"truncate-utf8-bytes@1.0.0","_shasum":"bba69230e63bc34fe53158c262d7950fa420590d","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"parshap","email":"parshap+npm@gmail.com"},"maintainers":[{"name":"carltonf","email":"xiongc05@gmail.com"},{"name":"parshap","email":""}],"dist":{"shasum":"bba69230e63bc34fe53158c262d7950fa420590d","size":49172,"noattachment":false,"key":"/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/truncate-utf8-bytes/download/truncate-utf8-bytes-1.0.0.tgz"},"directories":{},"publish_time":1446808727644,"_cnpm_publish_time":1446808727644,"_hasShrinkwrap":false}},"readme":"# truncate-utf8-bytes [![build status](https://secure.travis-ci.org/parshap/truncate-utf8-bytes.svg?branch=master)](http://travis-ci.org/parshap/truncate-utf8-bytes)\n\nTruncate a string to the given length in bytes. Correctly handles\nmulti-byte characters and surrogate pairs.\n\nA browser implementation that doesn't use `Buffer.byteLength` is\nprovided to minimize build size.\n\n## Example\n\n```js\nvar truncate = require(\"truncate-utf8-bytes\")\nvar str = \"a☃\" // a = 1 byte, ☃ = 3 bytes\nconsole.log(truncate(str, 2))\n// -> \"a\"\n```\n\n## API\n\n### `var truncate = require(\"truncate-utf8-bytes\")`\n\n*When using browserify or webpack*, this automatically resolves to an\nimplementation that does not use `Buffer.byteLength`.\n\n### `truncate(string, length)`\n\nReturns `string` truncated to at most `length` bytes in length.\n","_attachments":{},"homepage":"https://github.com/parshap/truncate-utf8-bytes#readme","bugs":{"url":"https://github.com/parshap/truncate-utf8-bytes/issues"},"license":"WTFPL"}