You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

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