1 | # regenerate-unicode-properties [![regenerate-unicode-properties on npm](https://img.shields.io/npm/v/regenerate-unicode-properties)](https://www.npmjs.com/package/regenerate-unicode-properties)
|
---|
2 |
|
---|
3 | _regenerate-unicode-properties_ is a collection of [Regenerate](https://github.com/mathiasbynens/regenerate) sets for [various Unicode properties](https://github.com/tc39/proposal-regexp-unicode-property-escapes).
|
---|
4 |
|
---|
5 | ## Installation
|
---|
6 |
|
---|
7 | To use _regenerate-unicode-properties_ programmatically, install it as a dependency via [npm](https://www.npmjs.com/):
|
---|
8 |
|
---|
9 | ```bash
|
---|
10 | $ npm install regenerate-unicode-properties
|
---|
11 | ```
|
---|
12 |
|
---|
13 | ## Usage
|
---|
14 |
|
---|
15 | To get a map of supported properties and their values:
|
---|
16 |
|
---|
17 | ```js
|
---|
18 | const properties = require('regenerate-unicode-properties');
|
---|
19 | ```
|
---|
20 |
|
---|
21 | To get a specific Regenerate set:
|
---|
22 |
|
---|
23 | ```js
|
---|
24 | // Examples:
|
---|
25 | const Lu = require('regenerate-unicode-properties/General_Category/Uppercase_Letter.js').characters;
|
---|
26 | const Greek = require('regenerate-unicode-properties/Script_Extensions/Greek.js').characters;
|
---|
27 | ```
|
---|
28 |
|
---|
29 | Some properties can also refer to strings rather than single characters:
|
---|
30 | ```js
|
---|
31 | const { characters, strings } = require('regenerate-unicode-properties/Property_of_Strings/Basic_Emoji.js');
|
---|
32 | ```
|
---|
33 |
|
---|
34 | To get the Unicode version the data was based on:
|
---|
35 |
|
---|
36 | ```js
|
---|
37 | const unicodeVersion = require('regenerate-unicode-properties/unicode-version.js');
|
---|
38 | ```
|
---|
39 |
|
---|
40 | ## For maintainers
|
---|
41 |
|
---|
42 | ### How to publish a new release
|
---|
43 |
|
---|
44 | 1. On the `main` branch, bump the version number in `package.json`:
|
---|
45 |
|
---|
46 | ```sh
|
---|
47 | npm version patch -m 'Release v%s'
|
---|
48 | ```
|
---|
49 |
|
---|
50 | Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).
|
---|
51 |
|
---|
52 | Note that this produces a Git commit + tag.
|
---|
53 |
|
---|
54 | 1. Push the release commit and tag:
|
---|
55 |
|
---|
56 | ```sh
|
---|
57 | git push && git push --tags
|
---|
58 | ```
|
---|
59 |
|
---|
60 | Our CI then automatically publishes the new release to npm.
|
---|
61 |
|
---|
62 | ## Author
|
---|
63 |
|
---|
64 | | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
---|
65 | |---|
|
---|
66 | | [Mathias Bynens](https://mathiasbynens.be/) |
|
---|
67 |
|
---|
68 | ## License
|
---|
69 |
|
---|
70 | _regenerate-unicode-properties_ is available under the [MIT](https://mths.be/mit) license.
|
---|