# @yozora/character

Latest version **2.4.1** (published 2026-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @yozora/character
pnpm add @yozora/character
yarn add @yozora/character
bun add @yozora/character
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.4.1 |
| Published | 2026-09-13 |
| First published | 2021-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 810.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 157 |
| Author | guanghechen |
| Maintainers | lemonclown |

## Links

- npm: https://www.npmjs.com/package/@yozora/character
- Repository: https://github.com/yozorajs/yozora
- Homepage: https://github.com/yozorajs/yozora/tree/v2.4.1/packages/character#readme
- npm.io page: https://npm.io/package/@yozora/character

## Recent versions

- 2.4.1 (latest) — 2026-09-13
- 2.4.0 — 2026-08-01
- 2.3.17 — 2026-07-10
- 2.3.16 — 2026-03-01
- 2.3.15 — 2026-03-01
- 2.3.14 — 2026-02-28
- 2.3.13 — 2025-11-30
- 2.3.12 — 2025-02-26
- 2.3.11 — 2025-01-13
- 2.3.10 — 2025-01-09
- 2.3.9 — 2024-12-05
- 2.3.8 — 2024-12-03
- 2.3.7 — 2024-11-06
- 2.3.6 — 2024-10-23
- 2.3.5 — 2024-10-06
- … 67 more at https://npm.io/package/@yozora/character/versions

## README

<!-- :begin use tokenizer/banner -->

<header>
  <h1 align="center">
    <a href="https://github.com/yozorajs/yozora/tree/v2.4.1/packages/character#readme">@yozora/character</a>
  </h1>
  <div align="center">
    <a href="https://www.npmjs.com/package/@yozora/character">
      <img
        alt="npm version"
        src="https://img.shields.io/npm/v/@yozora/character.svg"
      />
    </a>
    <a href="https://www.npmjs.com/package/@yozora/character">
      <img
        alt="npm downloads"
        src="https://img.shields.io/npm/dm/@yozora/character.svg"
      />
    </a>
    <a href="https://www.npmjs.com/package/@yozora/character">
      <img
        alt="npm license"
        src="https://img.shields.io/npm/l/@yozora/character.svg"
      />
    </a>
    <a href="#install">
      <img
        alt="Module formats: cjs, esm"
        src="https://img.shields.io/badge/module_formats-cjs%2C%20esm-green.svg"
      />
    </a>
    <a href="https://github.com/nodejs/node">
      <img
        alt="Node.js Version"
        src="https://img.shields.io/node/v/@yozora/character"
      />
    </a>
    <a href="https://github.com/vitest-dev/vitest">
      <img
        alt="Tested with Vitest"
        src="https://img.shields.io/badge/tested_with-vitest-6E9F18.svg"
      />
    </a>
    <a href="https://biomejs.dev/">
      <img
        alt="Code style: Biome"
        src="https://img.shields.io/badge/code_style-biome-60a5fa.svg?style=flat-square"
      />
    </a>
  </div>
</header>
<br />


<!-- :end -->

Character primitives used by Yozora tokenizers: code-point constants, character predicates,
source-position tracking, entity references, and Unicode case folding.

## Install

```bash
npm install --save @yozora/character
```

## Usage

```typescript
import {
  createNodePointGenerator,
  foldCase,
  isPunctuationCharacter,
} from '@yozora/character'

const points = [...createNodePointGenerator('Hello, 世界')]
const identifier = foldCase('Yozora')
const commaIsPunctuation = isPunctuationCharacter(','.codePointAt(0)!)
```

Key exports include:

- `AsciiCodePoint`, Unicode category enums, and `VirtualCodePoint`
- ASCII/Unicode whitespace, punctuation, control, digit, and letter predicates
- `createNodePointGenerator` and helpers for reading text from node-point intervals
- named and numeric entity-reference parsing
- `foldCase`, `stripChineseCharacters`, and `tightenChineseCharacters`

## Related

- [homepage][]

[homepage]: https://github.com/yozorajs/yozora/tree/v2.4.1/packages/character#readme

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