@texting/regex-charset
v0.2.2
Published
Regex sets
Downloads
2,376
Readme
@texting/regex-charset
A function returning string length, s.t. skipping ansi (escape) codes, correcting length of astral symbols.
Features
- ES2015 syntax
Install
$ npm install @texting/regex-charset
Usage
import { lange } from '@texting/assets-charset-ansi'
const list = [
'tolstoy',
'\u001b[3;4;31mhatsu\u001b[0m',
'\u{1F3C3}2\u{1F525}7',
]
for (let tx of list) {
console.log(`[${tx}] [length] (${tx.length}) [lange] (${lange(tx)})`)
}
Meta
Copyright (c) 2019-present, Haoyang (Vincent) Wang