@texting/regex-phrasing

0.2.2 • Public • Published

@texting/regex-phrasing

A function returning string length, s.t. skipping ansi (escape) codes, correcting length of astral symbols.

npm version npm quality npm download npm total-download size github commit activity npm license

Features

  • ES2015 syntax

Install

$ npm install @texting/regex-phrasing

Usage

import { lange } from '@texting/assets-phrasing'
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

LICENSE (MIT)

Copyright (c) 2019-present, Haoyang (Vincent) Wang

Readme

Keywords

Package Sidebar

Install

npm i @texting/regex-phrasing

Weekly Downloads

48

Version

0.2.2

License

MIT

Unpacked Size

4.46 kB

Total Files

4

Last publish

Collaborators

  • hoyeung