2.0.1 • Published 8 months ago

text-direction v2.0.1

Weekly downloads
102
License
MIT
Repository
github
Last release
8 months ago

text-direction

NPM Version Package Size

Get the text direction from an element node.

Installation

npm install text-direction

Usage

    import textDirection from "text-direction";
    // Or using a CDN without installation
    import textDirection from "https://unpkg.com/text-direction";

Then, you can start to use it on your code :

    const nodeDirection = textDirection(myNode); // With a node as argument for its specific direction
    const globalDirection = textDirection(); // Without argument to target <body>

Returned value are :

  • "ltr" if direction is right-to-left
  • "rtl" if direction is left-to-right
  • "" if the element specified has no style (not attached to a DOM)

License

MIT

2.0.1

8 months ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago