@spare/enum-quotes

String quotes

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@spare/enum-quotes
100.15.1524 days ago3 years agoMinified + gzip package size for @spare/enum-quotes in KB

Readme

@spare/enum-quotes

A function returning string length, s.t.
skipping ansi (escape) codes,
correcting length of astral symbols.
!npm versionnpm-imagenpm-url !npm qualityquality-imagequality-url !npm downloaddownload-imagenpm-url !npm total-downloadtotal-download-imagenpm-url !sizesizesize-url !github commit activitycommit-imagegithub-url !npm licenselicense-imagenpm-url

Features

  • ES2015 syntax

Install

$ npm install @spare/enum-quotes

Usage

import { lange } from '@spare/constants-quotes'
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