unicode-2.1.2

JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v2.1.2’s categories, scripts, blocks, bidi, and other properties.

npm install unicode-2.1.2
6 downloads in the last week
6 downloads in the last month

Unicode v2.1.2 data

JavaScript-compatible Unicode data for use in Node.js. Included: arrays of code points, arrays of symbols, and regular expressions for Unicode v2.1.2’s categories, scripts, blocks, and properties.

The data files in this module are generated as part of the node-unicode-data project.

Installation

npm install unicode-2.1.2 --save

Usage

// Get an array of code points in a given Unicode category:
var codePoints = require('unicode-2.1.2/categories/Lu/code-points');
// Get an array of symbols (strings) in a given Unicode category:
var symbols = require('unicode-2.1.2/categories/Lu/symbols');
// Get a regular expression that matches any symbol in a given Unicode category:
var regex = require('unicode-2.1.2/categories/Lu/regex');
// Get the canonical category a given code point belongs to:
// (Note: U+0041 is LATIN CAPITAL LETTER A)
var category = require('unicode-2.1.2/categories')[ 0x41 ];
// Get an array of all code points with the `Bidi_ON` bidi property:
var on = require('unicode-2.1.2/bidi/ON/code-points');
// Get the directionality of a given code point:
var directionality = require('unicode-2.1.2/bidi')[ 0x41 ];


// …you get the idea.

Other than categories, data on Unicode properties, blocks, and scripts is available too (for recent versions of the Unicode standard). Here’s the full list of the available data for v2.1.2:

// properties:

require('unicode-2.1.2/properties/Any/code-points');
require('unicode-2.1.2/properties/Any/symbols');
require('unicode-2.1.2/properties/Any/regex');

require('unicode-2.1.2/properties/Assigned/code-points');
require('unicode-2.1.2/properties/Assigned/symbols');
require('unicode-2.1.2/properties/Assigned/regex');

require('unicode-2.1.2/properties/ASCII/code-points');
require('unicode-2.1.2/properties/ASCII/symbols');
require('unicode-2.1.2/properties/ASCII/regex');

// categories:

require('unicode-2.1.2/categories')[ codePoint ]; // lookup array

require('unicode-2.1.2/categories/Cc/code-points');
require('unicode-2.1.2/categories/Cc/symbols');
require('unicode-2.1.2/categories/Cc/regex');

require('unicode-2.1.2/categories/C/code-points');
require('unicode-2.1.2/categories/C/symbols');
require('unicode-2.1.2/categories/C/regex');

require('unicode-2.1.2/categories/Zs/code-points');
require('unicode-2.1.2/categories/Zs/symbols');
require('unicode-2.1.2/categories/Zs/regex');

require('unicode-2.1.2/categories/Z/code-points');
require('unicode-2.1.2/categories/Z/symbols');
require('unicode-2.1.2/categories/Z/regex');

require('unicode-2.1.2/categories/Po/code-points');
require('unicode-2.1.2/categories/Po/symbols');
require('unicode-2.1.2/categories/Po/regex');

require('unicode-2.1.2/categories/P/code-points');
require('unicode-2.1.2/categories/P/symbols');
require('unicode-2.1.2/categories/P/regex');

require('unicode-2.1.2/categories/Sc/code-points');
require('unicode-2.1.2/categories/Sc/symbols');
require('unicode-2.1.2/categories/Sc/regex');

require('unicode-2.1.2/categories/S/code-points');
require('unicode-2.1.2/categories/S/symbols');
require('unicode-2.1.2/categories/S/regex');

require('unicode-2.1.2/categories/Ps/code-points');
require('unicode-2.1.2/categories/Ps/symbols');
require('unicode-2.1.2/categories/Ps/regex');

require('unicode-2.1.2/categories/Pe/code-points');
require('unicode-2.1.2/categories/Pe/symbols');
require('unicode-2.1.2/categories/Pe/regex');

require('unicode-2.1.2/categories/Sm/code-points');
require('unicode-2.1.2/categories/Sm/symbols');
require('unicode-2.1.2/categories/Sm/regex');

require('unicode-2.1.2/categories/Pd/code-points');
require('unicode-2.1.2/categories/Pd/symbols');
require('unicode-2.1.2/categories/Pd/regex');

require('unicode-2.1.2/categories/Nd/code-points');
require('unicode-2.1.2/categories/Nd/symbols');
require('unicode-2.1.2/categories/Nd/regex');

require('unicode-2.1.2/categories/N/code-points');
require('unicode-2.1.2/categories/N/symbols');
require('unicode-2.1.2/categories/N/regex');

require('unicode-2.1.2/categories/Lu/code-points');
require('unicode-2.1.2/categories/Lu/symbols');
require('unicode-2.1.2/categories/Lu/regex');

require('unicode-2.1.2/categories/L/code-points');
require('unicode-2.1.2/categories/L/symbols');
require('unicode-2.1.2/categories/L/regex');

require('unicode-2.1.2/categories/LC/code-points');
require('unicode-2.1.2/categories/LC/symbols');
require('unicode-2.1.2/categories/LC/regex');

require('unicode-2.1.2/categories/Sk/code-points');
require('unicode-2.1.2/categories/Sk/symbols');
require('unicode-2.1.2/categories/Sk/regex');

require('unicode-2.1.2/categories/Pc/code-points');
require('unicode-2.1.2/categories/Pc/symbols');
require('unicode-2.1.2/categories/Pc/regex');

require('unicode-2.1.2/categories/Ll/code-points');
require('unicode-2.1.2/categories/Ll/symbols');
require('unicode-2.1.2/categories/Ll/regex');

require('unicode-2.1.2/categories/So/code-points');
require('unicode-2.1.2/categories/So/symbols');
require('unicode-2.1.2/categories/So/regex');

require('unicode-2.1.2/categories/No/code-points');
require('unicode-2.1.2/categories/No/symbols');
require('unicode-2.1.2/categories/No/regex');

require('unicode-2.1.2/categories/Lo/code-points');
require('unicode-2.1.2/categories/Lo/symbols');
require('unicode-2.1.2/categories/Lo/regex');

require('unicode-2.1.2/categories/Lt/code-points');
require('unicode-2.1.2/categories/Lt/symbols');
require('unicode-2.1.2/categories/Lt/regex');

require('unicode-2.1.2/categories/Cn/code-points');
require('unicode-2.1.2/categories/Cn/symbols');
require('unicode-2.1.2/categories/Cn/regex');

require('unicode-2.1.2/categories/Lm/code-points');
require('unicode-2.1.2/categories/Lm/symbols');
require('unicode-2.1.2/categories/Lm/regex');

require('unicode-2.1.2/categories/Mn/code-points');
require('unicode-2.1.2/categories/Mn/symbols');
require('unicode-2.1.2/categories/Mn/regex');

require('unicode-2.1.2/categories/M/code-points');
require('unicode-2.1.2/categories/M/symbols');
require('unicode-2.1.2/categories/M/regex');

require('unicode-2.1.2/categories/Me/code-points');
require('unicode-2.1.2/categories/Me/symbols');
require('unicode-2.1.2/categories/Me/regex');

require('unicode-2.1.2/categories/Mc/code-points');
require('unicode-2.1.2/categories/Mc/symbols');
require('unicode-2.1.2/categories/Mc/regex');

require('unicode-2.1.2/categories/Cf/code-points');
require('unicode-2.1.2/categories/Cf/symbols');
require('unicode-2.1.2/categories/Cf/regex');

require('unicode-2.1.2/categories/Zl/code-points');
require('unicode-2.1.2/categories/Zl/symbols');
require('unicode-2.1.2/categories/Zl/regex');

require('unicode-2.1.2/categories/Zp/code-points');
require('unicode-2.1.2/categories/Zp/symbols');
require('unicode-2.1.2/categories/Zp/regex');

require('unicode-2.1.2/categories/Nl/code-points');
require('unicode-2.1.2/categories/Nl/symbols');
require('unicode-2.1.2/categories/Nl/regex');

require('unicode-2.1.2/categories/Cs/code-points');
require('unicode-2.1.2/categories/Cs/symbols');
require('unicode-2.1.2/categories/Cs/regex');

require('unicode-2.1.2/categories/Co/code-points');
require('unicode-2.1.2/categories/Co/symbols');
require('unicode-2.1.2/categories/Co/regex');

// bidi:

require('unicode-2.1.2/bidi')[ codePoint ]; // lookup array

require('unicode-2.1.2/bidi/ON/code-points');
require('unicode-2.1.2/bidi/ON/symbols');
require('unicode-2.1.2/bidi/ON/regex');

require('unicode-2.1.2/bidi/S/code-points');
require('unicode-2.1.2/bidi/S/symbols');
require('unicode-2.1.2/bidi/S/regex');

require('unicode-2.1.2/bidi/WS/code-points');
require('unicode-2.1.2/bidi/WS/symbols');
require('unicode-2.1.2/bidi/WS/regex');

require('unicode-2.1.2/bidi/ET/code-points');
require('unicode-2.1.2/bidi/ET/symbols');
require('unicode-2.1.2/bidi/ET/regex');

require('unicode-2.1.2/bidi/CS/code-points');
require('unicode-2.1.2/bidi/CS/symbols');
require('unicode-2.1.2/bidi/CS/regex');

require('unicode-2.1.2/bidi/ES/code-points');
require('unicode-2.1.2/bidi/ES/symbols');
require('unicode-2.1.2/bidi/ES/regex');

require('unicode-2.1.2/bidi/EN/code-points');
require('unicode-2.1.2/bidi/EN/symbols');
require('unicode-2.1.2/bidi/EN/regex');

require('unicode-2.1.2/bidi/L/code-points');
require('unicode-2.1.2/bidi/L/symbols');
require('unicode-2.1.2/bidi/L/regex');

require('unicode-2.1.2/bidi/R/code-points');
require('unicode-2.1.2/bidi/R/symbols');
require('unicode-2.1.2/bidi/R/regex');

require('unicode-2.1.2/bidi/AN/code-points');
require('unicode-2.1.2/bidi/AN/symbols');
require('unicode-2.1.2/bidi/AN/regex');

require('unicode-2.1.2/bidi/B/code-points');
require('unicode-2.1.2/bidi/B/symbols');
require('unicode-2.1.2/bidi/B/regex');

Author

twitter/mathias
Mathias Bynens

License

This module is available under the MIT license.

npm loves you