epitaphjs
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 • Public • Published

Epitaph JS

A text splitter plugin that does more

What does this plugin do?

Well, a whole bunch of stuff. It can split a sentence into letters and then wrap those letters in a tag. It can add iterators to the classes and have the inner and outer tags have different classes and an overlapping class. This plugin is pretty badass tbh.

How to use:

yarn add epitaphjs
npm install epitaphjs

Next import it into your project:

import Epitaph from 'epitaphjs'

You can also add it via cdn

    <script src="https://unpkg.com/epitaphjs"></script>

Initializing Epitaph

    // these are all of the options
    const options = {
        split: "letter" / "word" / "sentence",
            // how it should be split
        tag: DomNode,
            // which dom node to affect
        wrapWords: true/false
            // should the words be wrapped
        className: "",
            // all around class name
        return: true/false,
            // do you want to get the output of the plugin as a return or to alter the original dom node
        innerClass: "letter",
            // the class of the inner tags
        wrapperClass: "word",
            // the class of the wrapping
        separator: "_",
            // separate the class from the iterator,
        iterator: true/false
            // adds an iterator to the wrappings and the inners
    }
    const splitter = new Epitaph(domNode, options)

AND VOILA

Give me a shoutout @ alekangelov.com

Package Sidebar

Install

npm i epitaphjs

Weekly Downloads

21

Version

1.2.7

License

ISC

Unpacked Size

18.5 kB

Total Files

9

Last publish

Collaborators

  • alekangelov