The `codepoints` package provides a parser for the Unicode Character Database (UCD) files, producing a large array of JavaScript objects, each representing a Unicode codepoint with extensive properties like name, category, block, script, bidi class, and various casing and decomposition mappings. The current stable version is 1.3.0, and the package is primarily intended for use in build scripts, not directly in production applications, due to its significant memory footprint and unoptimized parsing speed. It bundles a default UCD, but also allows specifying a custom UCD path. For real-world applications requiring Unicode data, the project maintainers recommend using modules that provide precompiled and compressed data, such as `unicode-properties`. It does not follow a strict release cadence and has seen infrequent updates, reflecting its stable but specialized role.
npm install codepointsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `codepoints/parser` submodule to process a Unicode Character Database (UCD) from a custom directory, showcasing its primary use case for build scripts to generate structured Unicode data. It simulates a minimal UCD for demonstration purposes.
For production applications, use modules that provide precompiled and compressed Unicode data, such as `unicode-properties`, as recommended by the `codepoints` README.
If you need specific Unicode properties in a production application, consider pre-filtering and serializing only the necessary data during a build step using `codepoints`, or utilize libraries optimized for efficient runtime access to Unicode properties.
Ensure your environment supports CommonJS `require()`, or use a bundler that can handle CommonJS modules when targeting an ESM environment. If explicit ESM compatibility is required for newer Node.js versions, consider alternatives or a build process that transforms the output.
Either convert your module to CommonJS (e.g., by ensuring `type: 'commonjs'` in `package.json` or using a `.cjs` extension) or use dynamic `import()` for loading, if supported by the package, although `codepoints` is designed for `require()`.
Run `npm install codepoints` in your project directory. Verify that the `node_modules` directory contains the `codepoints` package. Ensure the import path is correct and relative to your project structure.
No dependency data recorded yet.