UNPKG

unicode-byte-truncate

Version:

Unicode aware string truncation that given a max byte size will truncate the string to or just below that size

51 lines (50 loc) 1.12 kB
{ "name": "unicode-byte-truncate", "version": "1.0.0", "description": "Unicode aware string truncation that given a max byte size will truncate the string to or just below that size", "main": "index.js", "dependencies": { "is-integer": "^1.0.6", "unicode-substring": "^0.1.0" }, "devDependencies": { "standard": "^6.0.4", "tape": "^4.4.0" }, "scripts": { "test": "standard && tape test.js" }, "repository": { "type": "git", "url": "git+https://github.com/watson/unicode-byte-truncate.git" }, "keywords": [ "slice", "substring", "substr", "trunc", "truncate", "trim", "unicode", "multibyte", "multi-byte", "surrogate", "pair", "pairs", "max", "byte", "bytes", "characters", "chars" ], "author": "Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)", "license": "MIT", "bugs": { "url": "https://github.com/watson/unicode-byte-truncate/issues" }, "homepage": "https://github.com/watson/unicode-byte-truncate#readme", "coordinates": [ 55.6666217, 12.5798077 ] }