# dart-text

> Characters manipulation using Dart's algorithm

Latest version **2.2.2** (published 2023-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install dart-text
pnpm add dart-text
yarn add dart-text
bun add dart-text
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2023-02-16 |
| First published | 2021-02-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 112 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | joseph1125 |
| Maintainers | joseph1125 |

## Links

- npm: https://www.npmjs.com/package/dart-text
- Repository: https://github.com/joseph1125/dart-text
- Homepage: https://github.com/joseph1125/dart-text#readme
- Issues: https://github.com/joseph1125/dart-text/issues
- npm.io page: https://npm.io/package/dart-text

## Recent versions

- 2.2.2 (latest) — 2023-02-16
- 2.2.1 — 2023-02-16
- 2.2.0 — 2023-02-16
- 2.1.3 — 2022-06-02
- 2.1.2 — 2022-06-02
- 2.1.1 — 2021-07-05
- 2.1.0 — 2021-03-15
- 2.0.3 — 2021-03-08
- 2.0.2 — 2021-03-08
- 2.0.1 — 2021-03-08
- 2.0.0 — 2021-03-05
- 1.1.2 — 2021-02-16
- 1.1.1 — 2021-02-11
- 1.1.0 — 2021-02-11
- 1.0.2 — 2021-02-11
- … 2 more at https://npm.io/package/dart-text/versions

## README

# DartText

a native JS implementation of functions of [dart characters library](https://github.com/dart-lang/characters)

Tested with support of Emoji V15 Spec

## Installation

```
npm i dart-text
```

## Usage

```js
const dartText = require('dart-text');

dartText.length('👨‍👨‍👧‍👧');
// returns 1

dartText.substring('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.', 7, 14);
// returns "👍🏽 are 🍆"

dartText.substr('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.', 7, 1);
// returns "👍🏽"

dartText.split('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.');
// returns ['E','m','o','j','i','s',' ','👍🏽',' ','a','r','e',' ','🍆',' ','p','o','i','s','o','n','.',' ','🌮','s',' ','a','r','e',' ','b','a','d','.']

dartText.firstIndexOf('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.', '👍🏽');
// returns 7
```

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