Detect directionality: left-to-right, right-to-left, or neutral
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitignore
.npmrc
.prettierignore
.travis.yml
LICENSE
cli.js
index.js
package.json
readme.md
test.js

readme.md

direction Build Status Coverage Status

Detect direction: left-to-right, right-to-left, or neutral.

API

Install:

npm install direction

Use:

var direction = require('direction')

direction('A') // => 'ltr'
direction('anglais') // => 'ltr'
direction('بسيطة') // => 'rtl'
direction('@') // => 'neutral'

CLI

Install:

npm install -g direction

Use:

Usage: direction [options] <words...>

Detect directionality: left-to-right, right-to-left, or neutral

Options:

  -h, --help           output usage information
  -v, --version        output version number

Usage:

# output directionality
$ direction @
# neutral

# output directionality from stdin
$ echo 'الانجليزية' | direction
# rtl

License

MIT © Titus Wormer