To use the generated data, simply install one of the npm modules generated by this script. Separate packages are available for each Unicode version. This allows you to do stuff like:
// Get an array of all code points with the `White_Space` property:var codePoints = require'unicode-6.3.0/properties/White_Space/code-points';// Get an array of strings (containing one symbol each) in the `Lu` category:var symbols = require'unicode-6.3.0/categories/Lu/symbols';// Get a regular expression that matches any symbol in the `Aegean Numbers` block:var regex = require'unicode-6.3.0/blocks/Aegean Numbers/regex';// Get an array of all code points in the `Egyptian_Hieroglyphs` script:var hieroglyphs = require'unicode-6.3.0/scripts/Egyptian_Hieroglyphs/code-points';// …you get the idea.
For more information, see the README for the package you’re interested in. Here’s the full list of npm packages generated by this script:
Note that these READMEs are auto-generated by this script, too – they describe all the data that is available for that particular Unicode version.
npm run-script download (re-)downloads the Unicode source files for all the Unicode versions defined in
data/resources.js, saving them in the
npm run-script generate generates data for categories, scripts, blocks, and properties for all the Unicode versions defined in
data/resources.js. This may take a few minutes… In total, roughly 1.5 GB of data is generated. The regular expressions are generated using Regenerate, and Punycode.js is used to convert code point arrays into arrays of symbols.
npm test generates the data for the oldest and latest available Unicode version. This is a good way to test changes to the generator scripts before running
npm run-script generate.
npm run-script cover generates the code coverage report.
This module is available under the MIT license.