# @marijn/find-cluster-break

> Find the position of grapheme cluster breaks in a string

Latest version **1.0.4** (published 2026-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @marijn/find-cluster-break
pnpm add @marijn/find-cluster-break
yarn add @marijn/find-cluster-break
bun add @marijn/find-cluster-break
```

## 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 | 1.0.4 |
| Published | 2026-08-21 |
| First published | 2024-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marijn Haverbeke |
| Maintainers | marijn |
| Keywords | unicode, grapheme, cluster, break |

## Links

- npm: https://www.npmjs.com/package/@marijn/find-cluster-break
- Repository: https://code.haverbeke.berlin/marijn/find-cluster-break
- Issues: https://code.haverbeke.berlin/marijn/find-cluster-break/issues
- npm.io page: https://npm.io/package/@marijn/find-cluster-break

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2026-08-21
- 1.0.3 — 2026-06-27
- 1.0.2 — 2024-12-09
- 1.0.1 — 2024-12-09
- 1.0.0 — 2024-10-06

## README

# @marijn/find-cluster-break

Small JavaScript module for finding grapheme cluster breaks in
strings, scanning from a given position.

```javascript
import {findClusterBreak} from "@marijn/find-cluster-break"
console.log(findClusterBreak("💪🏽🦋", 0))
// → 4
```

This code is open source, released under an MIT license.
    
## Documentation

**`findClusterBreak`**`(str: string, pos: number, forward = true, includeExtending = true): number`

Returns a next grapheme cluster break _after_ (not equal to) `pos`,
if `forward` is true, or before otherwise. Returns `pos` itself if no
further cluster break is available in the string. Moves across
surrogate pairs, extending characters (when `includeExtending` is
true, which is the default), characters joined with zero-width joiners,
and flag emoji.

**`isExtendingChar`**`(code: number): boolean`

Query whether the given character has a `Grapheme_Cluster_Break` value
of `Extend` in Unicode.

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