# @zachacious/textsplitter

> Splits text into individual elements for words and characters for the purpose of animation with the ability to revert back regular text

Latest version **1.0.1** (published 2022-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zachacious/textsplitter
pnpm add @zachacious/textsplitter
yarn add @zachacious/textsplitter
bun add @zachacious/textsplitter
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-02-06 |
| First published | 2022-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Zach Moore |
| Maintainers | zachacious |
| Keywords | text, split, splitting, div, span, animation, gsap |

## Links

- npm: https://www.npmjs.com/package/@zachacious/textsplitter
- Repository: https://github.com/Zachacious/TextSplitter
- Homepage: https://github.com/Zachacious/TextSplitter#readme
- Issues: https://github.com/Zachacious/TextSplitter/issues
- npm.io page: https://npm.io/package/@zachacious/textsplitter

## Dependencies (3)

- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [rollup](https://npm.io/package/rollup.md) ^2.67.0
- [rollup-plugin-uglify](https://npm.io/package/rollup-plugin-uglify.md) ^6.0.4

## Alternatives

- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads
- [cra-template-particles-typescript](https://npm.io/package/cra-template-particles-typescript.md) — 227 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-02-06

## README

# TextSplitter

Split an element with text into multiple elements containing words and chars.
Small < 2kb

## Installation

```bash
npm install @zachacious/textsplitter
```

## Usage

```javascript
import { TextSplitter } from "textsplitter";

/*All possible options*/
const options = {
  type: "word, char", // create word elements that contain character elements
  element: "div", // the new elements created will be divs
};

const myTextEls = TextSplitter.split("#text-el", options);

/* ...do some animation or something... */
/* myTextEls.words -> array of word elements */
/* myTextEls.chars -> array of char elements */

/* restore the original text element */
myTextEls.revert();
```

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