# @spare/regex-charset

> Regex sets

Latest version **0.16.16** (published 2025-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @spare/regex-charset
pnpm add @spare/regex-charset
yarn add @spare/regex-charset
bun add @spare/regex-charset
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.16.16 |
| Published | 2025-03-14 |
| First published | 2020-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Hoyeung Wong |
| Maintainers | hoyeung |
| Keywords | test, console, debug, print |

## Links

- npm: https://www.npmjs.com/package/@spare/regex-charset
- Repository: https://github.com/gadge/spare
- Homepage: https://github.com/gadge/spare#readme
- Issues: https://github.com/gadge/spare
- npm.io page: https://npm.io/package/@spare/regex-charset

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.16.16 (latest) — 2025-03-14
- 0.16.15 — 2025-03-14
- 0.16.14 — 2025-03-14
- 0.16.13 — 2025-03-14
- 0.16.12 — 2025-03-14
- 0.16.11 — 2025-03-14
- 0.16.10 — 2025-03-10
- 0.16.9 — 2025-03-10
- 0.16.8 — 2025-03-03
- 0.16.7 — 2025-03-02
- 0.16.6 — 2025-03-02
- 0.16.5 — 2025-03-01
- 0.16.4 — 2025-03-01
- 0.16.3 — 2025-02-26
- 0.16.2 — 2024-11-13
- … 103 more at https://npm.io/package/@spare/regex-charset/versions

## README

## @spare/regex-charset
A function returning string length,
s.t. 
    skipping ansi (escape) codes,
    correcting length of astral symbols.

[![npm version][npm-image]][npm-url]
[![npm quality][quality-image]][quality-url]
[![npm download][download-image]][npm-url]
[![npm total-download][total-download-image]][npm-url]
[![size][size]][size-url]
[![github commit activity][commit-image]][github-url]
[![npm license][license-image]][npm-url]

## Features

- ES2015 syntax

## Install
```console
$ npm install @spare/regex-charset
```

## Usage
```js
import { lange } from '@spare/regex-charset'
const cast = [
  'tolstoy',
  '\u001b[3;4;31mhatsu\u001b[0m',
  '\u{1F3C3}2\u{1F525}7',
]
for (let t of cast) {
  console.log(`[${t}] [length] (${t.length}) [lange] (${lange(t)})`)
}
```

## Meta
[LICENSE (MIT)](LICENSE)

Copyright (c) 2019-present, Haoyang (Vincent) Wang

[//]: <> (Shields)
[npm-image]: https://img.shields.io/npm/v/@spare/regex-charset.svg?style=flat-square
[quality-image]: http://npm.packagequality.com/shield/@spare/regex-charset.svg?style=flat-square
[download-image]: https://img.shields.io/npm/dm/@spare/regex-charset.svg?style=flat-square
[total-download-image]:https://img.shields.io/npm/dt/@spare/regex-charset.svg?style=flat-square
[license-image]: https://img.shields.io/npm/l/@spare/regex-charset.svg?style=flat-square
[commit-image]: https://img.shields.io/github/commit-activity/y/hoyeungw/spare/regex-charset?style=flat-square
[size]: https://flat.badgen.net/packagephobia/install/@spare/regex-charset

[//]: <> (Link)
[npm-url]: https://npmjs.org/package/@spare/regex-charset
[quality-url]: http://packagequality.com/#?package=@spare/regex-charset
[github-url]: https://github.com/gadge/@spare/regex-charset
[size-url]: https://packagephobia.now.sh/result?p=@spare/regex-charset

---
_Source: https://npm.io/package/@spare/regex-charset · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
