String Direction
String Direction is a JavaScript library for detection of direction of String objects in JavaScript.
Usage
#getDirection
var stringDirection = ;stringDirection; // 'ltr'stringDirection; // 'rtl'
#patch Patching String objects globally
By using patch() method a getDirection method will be exposed in String object.
;"Hello, world!"; // "ltr""سلام دنیا"; // "rtl"
Installation
String Direction works both in browser or NodeJS environment
Node
Install via NPM
npm install string-direction
Browser
Use script tag to include the library
Credits
This library is influenced by string-direction Ruby library by Marc Busqué
License
MIT