Neverending Package Mountain
    Have ideas to improve npm?Join in the discussion! »

    directionality

    0.1.0 • Public • Published

    directionality

    Determines the writing system's directionality based on characters tests.

    Installation

    $ component install component/directionality
    

    Example

    var dir = require('directionality');
    dir('الولايات المتحدة الأمريكية'); // 'right'
    dir('Hello world'); // 'left'

    Method

    The decision is made based on the first character of the input string.

    API

    directionality(str)

    Returns 'rtl' for right-to-left text, and 'ltr' for left-to-right text.

    directionality.regex.ltr

    Access the regular expression of ltr charecters.

    directionality.regex.rtl

    Access the regular expression of rtl charecters.

    License

    MIT

    Keywords

    none

    Install

    npm i directionality

    DownloadsWeekly Downloads

    1

    Version

    0.1.0

    License

    none

    Last publish

    Collaborators

    • avatar