What is unicode-canonical-property-names-ecmascript?
The unicode-canonical-property-names-ecmascript npm package provides a comprehensive list of canonical Unicode property names as defined in the ECMAScript specification. This package is particularly useful for developers working with internationalization, regular expressions, and any functionality that requires manipulation or recognition of Unicode characters based on their properties.
What are unicode-canonical-property-names-ecmascript's main functionalities?
Retrieving Canonical Unicode Property Names
This feature allows developers to check if a given property name is a canonical Unicode property name according to the ECMAScript specification. The code sample demonstrates how to check if certain strings are recognized canonical property names.
"use strict";
const unicodeProps = require('unicode-canonical-property-names-ecmascript');
console.log(unicodeProps.includes('ASCII')); // false
console.log(unicodeProps.includes('General_Category')); // true
Other packages similar to unicode-canonical-property-names-ecmascript
unicode-property-aliases-ecmascript
Similar to unicode-canonical-property-names-ecmascript, this package provides aliases for Unicode property names as per the ECMAScript specification. While unicode-canonical-property-names-ecmascript focuses on canonical names, unicode-property-aliases-ecmascript deals with their aliases, offering a complementary functionality for developers dealing with Unicode properties.
regexpu-core
regexpu-core is a package that allows you to transform Unicode-aware regular expressions into equivalent ES5 regular expressions. Although it serves a different purpose by focusing on regular expression transformation, it shares the common theme of enhancing Unicode support in JavaScript, similar to what unicode-canonical-property-names-ecmascript offers by providing property names for Unicode character recognition.
unicode-canonical-property-names-ecmascript
unicode-canonical-property-names-ecmascript exports the set of canonical Unicode property names that are supported in ECMAScript RegExp property escapes.
Installation
To use unicode-canonical-property-names-ecmascript, install it as a dependency via npm:
$ npm install unicode-canonical-property-names-ecmascript
Then, require
it:
const properties = require('unicode-canonical-property-names-ecmascript');
Example
properties.has('ID_Start');
properties.has('IDS');
For maintainers
How to publish a new release
-
On the main
branch, bump the version number in package.json
:
npm version patch -m 'Release v%s'
Instead of patch
, use minor
or major
as needed.
Note that this produces a Git commit + tag.
-
Push the release commit and tag:
git push && git push --tags
Our CI then automatically publishes the new release to npm.
Author
License
unicode-canonical-property-names-ecmascript is available under the MIT license.