0.3.1 • Published 10 months ago

@gregoire.ciles/split-text v0.3.1

Weekly downloads
-
License
gpl-3.0
Repository
github
Last release
10 months ago

SplitText

Fast Track ⏱️

Discover the library in less than 5 minutes.

Install Node.js and install SplitText using your favorite package manager.

npm install @gregoire.ciles/split-text
yarn add @gregoire.ciles/split-text
pnpm add @gregoire.ciles/split-text

Then, open your favorite code editor and create new files index.html and index.ts.

<h1 id="my-element">
  SplitText is a small and type-safe library that split HTML text into characters and/or words.
</h1>
import SplitText from '@gregoire.ciles/split-text';

// DOM element
const element = document.getElementById('my-element');

const { chars, words } = new SplitText(element);

console.log({ chars, words });

Finally, open index.html in your browser and open the console to see the result.

TypeScript Support

SplitText is written in TypeScript and provides type definitions.

Note: TypeScript is not required to use SplitText.

💡 TIP: Type annotations are very useful and help your IDE understand the type provided by SplitText. The IDEs (VSCode, WebStorm, etc.) will be able to provide you with autocompletion and type hints.

Credits

© Grégoire Ciles

Licence

GNU General Public License v3.0

0.3.1

10 months ago

0.3.0

11 months ago

0.2.2

12 months ago

0.2.1

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago