
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
unicharadata
Advanced tools
unicharadata
moduleJavaScript module for accessing Unicode character data from UnicodeData.txt.
Install with npm
command as:
npm install unicharadata
then, load it in js files as:
const unicharadata = require("unicharadata");
NOTE: For file size reducing, The current module implementation embeds UnicodeData.txt source and builds complete character database on load time.
This method uses large pre built database json file. It would be about 1sec fatser than building database (around 4sec).
const unicharadata = require("unicharadata/trial/unicharadata-load");
Load with standard script
tag as:
<script src="unicharadata.js"></script>
see: browser-example.html ( demo )
Links via CDN
NOTE: Detail of the character propeties are in http://www.unicode.org/reports/tr44/#UnicodeData.txt
unicharadata.lookup(name, defaultch = "")
: search character from its name
unicharadata.lookupname(ch, defaultname = "")
: get the name used lookup(name)
unicharadata.name(ch, defaultname = "")
: get "Name" stringunicharadata.category(ch)
: get "General Category" string
unicharadata.combining(ch)
: get "Canonical Combining Class" number
unicharadata.bidirectional(ch)
: get "Bidi Class" string
unicharadata.decomposition(ch)
: get "Decomposition Mapping" text
ch
itself when no decomposition mappingunicharadata.decompositionTag(ch)
: get "Decomposition Type" tag string
unicharadata.decimal(ch, defaultval = NaN)
: get "Numeric Value" integer as single decimal typeunicharadata.digit(ch, defaultval = NaN)
: get "Numeric Value" integer as single digit type
decimal(ch)
. this includes as superscript (e.g. U+00B9)unicharadata.numeric(ch, defaultval = NaN)
: get "Numeric Value" float number as numeric type
digit(ch)
, this includes non single digit numbers.unicharadata.mirrored(ch)
: get "Bidi Mirrored" string
"Y"
or "N"
unicharadata.unicode1name(ch, defaultname = "")
: get "Unicode 1 Name" stringunicharadata.isocomment(ch, defaultcomment = "")
: get "ISO Comment" stringunicharadata.upper(ch, defaultch = "")
: get "Simple Uppercase Mapping" characterunicharadata.lower(ch, defaultch = "")
: get "Simple Lowercase Mapping" characterunicharadata.title(ch, defaultch = "")
: get "Simple Titlecase Mapping" characterunicharadata.splitCombined(text)
: split a text to an array of strings that contains a character and following combining characters."use strict";
const unicharadata = require("unicharadata");
// API
console.assert(unicharadata.name("A") === "LATIN CAPITAL LETTER A");
console.assert(unicharadata.lookup("LATIN CAPITAL LETTER A") === "A");
console.assert(unicharadata.category("A") === "Lu");
console.assert(unicharadata.combining("A") === 0);
console.assert(unicharadata.bidirectional("A") === "L");
console.assert(unicharadata.decomposition("A") === "A");
console.assert(unicharadata.decompositionTag("A") === "");
console.assert(isNaN(unicharadata.decimal("A")));
console.assert(isNaN(unicharadata.digit("A")));
console.assert(isNaN(unicharadata.numeric("A")));
console.assert(unicharadata.mirrored("A") === "N");
console.assert(unicharadata.unicode1name("A") === "");
console.assert(unicharadata.lookupname("A") === "LATIN CAPITAL LETTER A");
console.assert(unicharadata.isocomment("A") === "");
console.assert(unicharadata.upper("A") === "");
console.assert(unicharadata.lower("A") === "a");
console.assert(unicharadata.title("A") === "");
const splitted = unicharadata.splitCombined("これが🔑です".normalize("NFD"));
console.assert(splitted[0] === "こ");
console.assert(splitted[1] === "れ");
console.assert(splitted[2] === "が".normalize("NFD"));
console.assert(splitted[3] === "🔑");
console.assert(splitted[4] === "で".normalize("NFD"));
console.assert(splitted[5] === "す");
// specific
console.assert(unicharadata.decomposition("㍍") === "メートル");
console.assert(unicharadata.decompositionTag("㍍") === "<square>");
console.assert(unicharadata.decimal("1") === 1);
console.assert(unicharadata.digit("④") === 4);
console.assert(unicharadata.numeric("⅛") === 1 / 8);
console.assert(unicharadata.unicode1name("\n") === "LINE FEED (LF)");
console.assert(unicharadata.lookupname("\n") === "LINE FEED (LF)");
npm run download
: update UnicodeData.json
from UnicodeData.txt
on the webnpm run build
: update unicharadata.js
from unicharadata-raw.js
and
UnicodeData.json
npm test
: run testsnpm run eslint
: check coding style with eslint
npm install
requiredThe package version is based on the
Unicode "Version" of UnicodeData.txt
.
9.0.0-alpha.2
: the Unicode version is 9.0.0
unicharadata
website: https://github.com/bellbind/unicharadataunicodedata
lib: https://docs.python.org/3/library/unicodedata.html
FAQs
Access Unicode character data from UnicodeData.txt
The npm package unicharadata receives a total of 56 weekly downloads. As such, unicharadata popularity was classified as not popular.
We found that unicharadata demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.