An implementation of Unicode 9.0.0 Bidirectional Algorithm
npm install unicode-bidirectional


A Javascript implementation of the Unicode 9.0.0 Bidirectional Algorithm
This is an implementation of the Unicode Bidirectional Algorithm (UAX #9) that
works in both Browser and Node.js environments. The implementation is conformant as per definition UAX#9-C1.
npm install unicode-bidirectional --save
`
Usage
unicode-bidirectional is declared as a Universal Module (UMD),
meaning it can be used with all conventional Javascript module systems:
#### 1. ES6 →
`javascript
import { resolve, reorder } from 'unicode-bidirectional';const codepoints = [0x28, 0x29, 0x2A, 0x05D0, 0x05D1, 0x05D2]
const levels = resolve(codepoints, 0); // [0, 0, 0, 1, 1, 1]
const reordering = reorder(codepoints, levels); // [0x28, 0x29, 0x2A, 0x05D2, 0x05D1, 0x05D0]
`#### 2. CommonJS →
`javascript
var UnicodeBidirectional = require('unicode-bidirectional');
var resolve = UnicodeBidirectional.resolve;
var reorder = UnicodeBidirectional.reorder;var codepoints = [0x28, 0x29, 0x2A, 0x05D0, 0x05D1, 0x05D2]
var levels = resolve(codepoints, 0); // [0, 0, 0, 1, 1, 1]
var reordering = reorder(codepoints, levels); // [0x28, 0x29, 0x2A, 0x05D2, 0x05D1, 0x05D0]
`#### 3. RequireJS →
`javascript
require(['UnicodeBidirectional'], function (UnicodeBidirectional) {
var resolve = UnicodeBidirectional.resolve;
var reorder = UnicodeBidirectional.reorder; var codepoints = [0x28, 0x29, 0x2A, 0x05D0, 0x05D1, 0x05D2]
var levels = resolve(codepoints, 0); // [0, 0, 0, 1, 1, 1]
var reordering = reorder(codepoints, levels); // [0x28, 0x29, 0x2A, 0x05D2, 0x05D1, 0x05D0]
});
`
#### 4. HTML5