# crdt-richtext-wasm

> ## Usage

Latest version **0.4.0** (published 2023-05-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install crdt-richtext-wasm
pnpm add crdt-richtext-wasm
yarn add crdt-richtext-wasm
bun add crdt-richtext-wasm
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-05-17 |
| First published | 2023-05-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rem2018 |

## Links

- npm: https://www.npmjs.com/package/crdt-richtext-wasm
- npm.io page: https://npm.io/package/crdt-richtext-wasm

## Recent versions

- 0.4.0 (latest) — 2023-05-17
- 0.3.1 — 2023-05-11
- 0.3.0 — 2023-05-11

## README

# crdt-richtext-wasm

## Usage

```typescript
const text = new RichText(BigInt(2));
text.insert(0, "123");
text.annotate(0, 1, "bold", AnnotateType.BoldLike);
text.insert(1, "k");
{
  const spans = text.getAnnSpans();
  expect(spans[0].text).toBe("1k");
  expect(spans[0].annotations).toStrictEqual(new Set(["bold"]));
}

text.eraseAnn(0, 2, "bold", AnnotateType.BoldLike);
{
  const spans = text.getAnnSpans();
  expect(spans[0].text).toBe("1k23");
  expect(spans[0].annotations.size).toBe(0);
}
```

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