Skip to content
This repository was archived by the owner on Jun 25, 2026. It is now read-only.

Commit 56c302e

Browse files
committed
docs: rewrite README with why section, updated quick start, and docs links
1 parent 94789e6 commit 56c302e

1 file changed

Lines changed: 51 additions & 31 deletions

File tree

README.md

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<img src="https://raw.githubusercontent.com/eoussama/eo-typewriterjs/refs/heads/master/assets/logo.svg" alt="Logo" width="200px">
44
<h1 align="center">eo-typewriterjs</h1>
55
</a>
6-
<p align="center">Advanced typewriter-style text animation utility for JavaScript, with timeline playback, cursor movement, selection, deletion, and renderer-agnostic text styling.</p>
6+
<p align="center">Build rich typewriter animations with a composable timeline, full Unicode support, and a renderer-agnostic architecture that works in the browser and on the server.</p>
77
<p align="center">
88
<img src="https://img.shields.io/github/release/EOussama/typewriterjs.svg">
99
<img src="https://img.shields.io/github/downloads/EOussama/typewriterjs/latest/total.svg">
@@ -20,53 +20,73 @@
2020
pnpm add eo-typewriterjs
2121
```
2222

23+
## Why eo-typewriterjs
24+
25+
- **Composable timeline**: chain type, delete, wait, move, select, and call commands in any order
26+
- **Flexible advance modes**: type by character, word, line, grapheme, or custom chunk size
27+
- **Rich text support**: apply styles and marks to ranges during playback
28+
- **Full Unicode**: handles emoji, accented characters, and complex grapheme clusters correctly
29+
- **Renderer-agnostic**: built-in DOM and string renderers; implement `IRenderer` to target anything
30+
- **TypeScript-first**: fully typed public API with no `any`
31+
- **Playback controls**: play, pause, stop, replay, and cancel from any point
32+
2333
## Quick start
2434

2535
```ts
2636
import { createTypewriter, domRenderer } from "eo-typewriterjs";
2737

2838

2939

30-
const element = document.getElementById("output");
40+
const el = document.getElementById("output")!;
3141

32-
if (element === null) {
33-
throw new Error("Missing #output element");
34-
}
35-
36-
const typewriter = createTypewriter({
37-
renderer: domRenderer(element),
42+
const tw = createTypewriter({
43+
renderer: domRenderer(el),
3844
});
3945

40-
typewriter.timeline
41-
.type("Hello ")
42-
.type("world!", { style: "accent" })
43-
.mark("highlight", { from: 6, to: 12 });
46+
tw.timeline
47+
.type("Hello, ")
48+
.type("world!", { by: "word", interval: 120 })
49+
.wait(400)
50+
.delete({ amount: 6 })
51+
.type("eo-typewriterjs.", { interval: 80 });
4452

45-
await typewriter.play();
53+
await tw.play();
4654
```
4755

48-
## Common commands
56+
## Documentation
4957

50-
```bash
51-
pnpm dev
52-
pnpm build
53-
pnpm test
54-
pnpm lint
55-
pnpm sandbox
56-
pnpm docs:dev
57-
pnpm docs:build
58-
```
58+
Full documentation, guides, and the API reference are available on the docs site.
5959

60-
## Documentation
60+
- [Docs site](https://ouss.es/eo-typewriterjs/)
61+
- [Getting started](https://ouss.es/eo-typewriterjs/guide/getting-started)
62+
- [Core concepts](https://ouss.es/eo-typewriterjs/guide/core-concepts)
63+
- [Timeline](https://ouss.es/eo-typewriterjs/guide/timeline)
64+
- [Renderers](https://ouss.es/eo-typewriterjs/guide/renderers)
65+
- [Recipes](https://ouss.es/eo-typewriterjs/guide/recipes)
66+
- [API reference](https://ouss.es/eo-typewriterjs/api/)
6167

62-
Full documentation is available at the [docs site](https://eoussama.github.io/eo-typewriterjs/).
68+
## Sandbox
6369

64-
- [Getting Started](https://eoussama.github.io/eo-typewriterjs/guide/getting-started)
65-
- [Core Concepts](https://eoussama.github.io/eo-typewriterjs/guide/core-concepts)
66-
- [Timeline & Commands](https://eoussama.github.io/eo-typewriterjs/guide/timeline)
67-
- [Renderers](https://eoussama.github.io/eo-typewriterjs/guide/renderers)
68-
- [Recipes](https://eoussama.github.io/eo-typewriterjs/guide/recipes)
69-
- [API Reference](https://eoussama.github.io/eo-typewriterjs/api/)
70+
Try the library live in the interactive [sandbox](https://ouss.es/eo-typewriterjs/sandbox/), write timelines, run them, and see output in real time without any setup.
71+
72+
## Testing
73+
74+
The library is covered by two test layers:
75+
76+
- **Unit tests** (`pnpm test`): Vitest suite covering core logic, reducers, renderers, and edge cases.
77+
- **End-to-end tests** (`pnpm e2e`): Playwright suite running real playback scenarios in a browser harness, including typing flows, waiting, multiline output, cursor movement, selection, editing, and callbacks.
78+
79+
## Development
80+
81+
```bash
82+
pnpm dev # start dev server
83+
pnpm build # build the library
84+
pnpm test # run unit tests
85+
pnpm e2e # run end-to-end tests
86+
pnpm lint # lint
87+
pnpm sandbox # start the sandbox
88+
pnpm docs:dev # start the docs site
89+
```
7090

7191
## License
7292

0 commit comments

Comments
 (0)