# runes2

> Unicode-aware JS string splitting, typescript version

Latest version **1.1.10** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install runes2
pnpm add runes2
yarn add runes2
bun add runes2
```

## 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.1.10 |
| Published | 2026-09-11 |
| First published | 2018-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 120.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Vitaly Domnikov |
| Maintainers | bluelovers |
| Keywords | char, emoji, runes, split, split string, string, unicode, create-by-yarn-tool, create-by-tsdx |

## Links

- npm: https://www.npmjs.com/package/runes2
- Repository: https://github.com/bluelovers/ws-string
- Homepage: https://github.com/bluelovers/ws-string/tree/master/packages/runes2#readme
- Issues: https://github.com/bluelovers/ws-string/issues
- npm.io page: https://npm.io/package/runes2

## 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.1.10 (latest) — 2026-09-11
- 1.1.9 — 2026-09-11
- 1.1.8 — 2026-09-11
- 1.1.4 — 2024-01-29
- 1.1.3 — 2023-11-24
- 1.1.2 — 2023-04-12
- 1.1.1 — 2023-04-12
- 1.0.10 — 2022-11-01
- 1.0.9 — 2022-10-15
- 1.0.8 — 2022-09-16
- 1.0.7 — 2022-08-27
- 1.0.5 — 2022-08-26
- 1.0.3 — 2022-08-26
- 1.0.2 — 2022-08-26
- 1.0.1 — 2022-08-24
- … 10 more at https://npm.io/package/runes2/versions

## README

# ✂️ Runes

> Unicode-aware JS string splitting with full Emoji support.

Split a string into its constituent characters, without munging emoji and other non-BMP code points.

**this is typescript version fork form [`runes`](https://www.npmjs.com/package/runes)**

## Why?

The native `String#split` implementation does not pay attention to [surrogate pairs](http://en.wikipedia.org/wiki/UTF-16). When the code units of a surrogate pair are split apart, they are not intelligible on their own. Unless they are put back together in the correct order, individual code units will cause problems in code that handles strings.

## 安裝 (Installation)

```bash
# 使用 yarn / Using yarn
yarn add runes2

# 使用 yarn-tool / Using yarn-tool
yarn-tool add runes2
# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool
yt add runes2

# 使用 pnpm / Using pnpm
pnpm add runes2

# 使用 npm / Using npm
npm install runes2
```

## Example

```ts
const runes = require('runes2').default
const runes = require('runes2').runes
import runes from 'runes2';
import { runes } from 'runes2';
```

```js
// Standard String.split
'♥️'.split('') // => ['♥', '️']
'Emoji 🤖'.split('') // => ['E', 'm', 'o', 'j', 'i', ' ', '�', '�']
'👩‍👩‍👧‍👦'.split('') // => ['�', '�', '‍', '�', '�', '‍', '�', '�', '‍', '�', '�']

// ES6 string iterator
	[
...
'♥️'
] =>
['♥', '️']
	[
...
'Emoji 🤖'
] // => [ 'E', 'm', 'o', 'j', 'i', ' ', '🤖' ]
[...'👩‍👩‍👧‍👦'] // => [ '👩', '', '👩', '', '👧', '', '👦' ]

// Runes
runes('♥️') // => ['♥️']
runes('Emoji 🤖') // => ['E', 'm', 'o', 'j', 'i', ' ', '🤖']
runes('👩‍👩‍👧‍👦') // => ['👩‍👩‍👧‍👦']

```

## Substring example

```js
// String.substring
'👨‍👨‍👧‍👧a'.substring(1) // => '�‍👨‍👧‍👧a'

// Runes
runes.substr('👨‍👨‍👧‍👧a', 1) // => 'a'
```

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