1.0.0 • Published 4 years ago

@alsolovyev/splitter v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

šŸ“¦ Splitter

JavaScript package to split an element by words or characters. Demo: alsolovyev.github.io/npm-packages/splitter

License: MIT

Splitter

šŸš€ Usage

Install with NPM:

npm install @alsolovyev/splitter --save
<h1 id='title'>ĀÆ\_(惄)_/ĀÆ</h1>
import split from '@alsolovyev/splitter'

split(document.getElementById('title'))

Through the script tag:

<h1 id='title'>ĀÆ\_(惄)_/ĀÆ</h1>

<script src="https://cdn.jsdelivr.net/npm/@alsolovyev/splitter@latest/dist/splitter.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/@alsolovyev/splitter@latest/dist/splitter.min.js"></script>
split(document.getElementById('title'))

šŸ“˜ Parameters

element

Type: HTMLElement | Element Required: true

An HTML element whose content needs to be splitted

by

Type: 'chars' | 'words' Default: 'chars'

Content split type

šŸ§‘ Authors

šŸ“– License

This project is licensed under the MIT License