npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

codepoints

v1.3.0

Published

A parser for files in the Unicode database

Downloads

305

Readme

codepoints

A parser for files in the Unicode database. Produces a giant array of codepoint objects for every character represented by Unicode, with many properties derived from files in the Unicode database.

BUILD SCRIPTS ONLY: Use in production is not recommended as the parsers are not optimized for speed, the text files are huge, and the resulting array uses a huge amount of memory. To access this data in real world applications, use modules that have precompiled the data into a compressed form:

Installation

Install using npm:

npm install codepoints

Usage

Basic usage:

codepoints = require('codepoints');

The parser generates data by reading the text files contained in the Unicode Character Database. By default, it will use the database bundled with this package. To use a custom version of UCD, use codepoints/parser instead, which accepts an optional path to a directory containing the uncompressed UCD data:

parser = require('codepoints/parser');
codepoints = parser('/path/to/UCD');

Codepoint data

Each element in the generated array is either undefined (for unassigned code points), or an object containing the following properties:

  • code - the code point index
  • name - character name
  • unicode1Name - legacy name used by Unicode 1
  • category - Unicode category
  • block - the block name this character is a part of
  • script - the script this character belongs to
  • eastAsianWidth - the east asian width for this character
  • combiningClass - numeric combining class value
  • combiningClassName - a string name for the combining class
  • bidiClass - class for the Unicode bidirectional algorithm
  • bidiMirrored - whether the character is mirrored in the bidi algorithm
  • numeric - the numeric value for this character
  • uppercase - an array of code points mapping this character to upper case, if any
  • lowercase - an array of code points mapping this character to lower case, if any
  • titlecase - an array of code points mapping this character to title case, if any
  • folded - an array of code points mapping this character to a folded equivalent, if any
  • caseConditions - conditions used during case mapping for this character
  • decomposition - an array of code points that this character decomposes into. Used by the Unicode normalization algorithm.
  • compositions - a dictionary mapping of compositions for this character
  • isCompat - whether the decomposition is a compatibility one
  • isExcluded - whether the character is excluded from composition
  • NFC_QC - quickcheck value for NFC (0 = YES, 1 = NO, 2 = MAYBE)
  • NFKC_QC - quickcheck value for NFKC (0 = YES, 1 = NO, 2 = MAYBE)
  • NFD_QC - quickcheck value for NFD (0 = YES, 1 = NO)
  • NFKD_QC - quickcheck value for NFKD (0 = YES, 1 = NO)
  • joiningType - arabic joining type
  • joiningGroup - arabic joining group

License

MIT