Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
2.0 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | # unicode-property-aliases-ecmascript [![Build status](https://travis-ci.org/mathiasbynens/unicode-property-aliases-ecmascript.svg?branch=main)](https://travis-ci.org/mathiasbynens/unicode-property-aliases-ecmascript) [![unicode-property-aliases-ecmascript on npm](https://img.shields.io/npm/v/unicode-property-aliases-ecmascript)](https://www.npmjs.com/package/unicode-property-aliases-ecmascript)
|
---|
| 2 |
|
---|
| 3 | _unicode-property-aliases-ecmascript_ offers Unicode property alias mappings in an easy-to-consume JavaScript format. It only contains the Unicode property names that are supported in [ECMAScript RegExp property escapes](https://github.com/tc39/proposal-regexp-unicode-property-escapes).
|
---|
| 4 |
|
---|
| 5 | It’s based on Unicode’s `PropertyAliases.txt`.
|
---|
| 6 |
|
---|
| 7 | ## Installation
|
---|
| 8 |
|
---|
| 9 | To use _unicode-property-aliases-ecmascript_ programmatically, install it as a dependency via [npm](https://www.npmjs.com/):
|
---|
| 10 |
|
---|
| 11 | ```bash
|
---|
| 12 | $ npm install unicode-property-aliases-ecmascript
|
---|
| 13 | ```
|
---|
| 14 |
|
---|
| 15 | Then, `require` it:
|
---|
| 16 |
|
---|
| 17 | ```js
|
---|
| 18 | const propertyAliases = require('unicode-property-aliases-ecmascript');
|
---|
| 19 | ```
|
---|
| 20 |
|
---|
| 21 | ## Usage
|
---|
| 22 |
|
---|
| 23 | This module exports a `Map` object. The most common usage is to convert a property alias to its canonical form:
|
---|
| 24 |
|
---|
| 25 | ```js
|
---|
| 26 | propertyAliases.get('scx')
|
---|
| 27 | // → 'Script_Extensions'
|
---|
| 28 | ```
|
---|
| 29 |
|
---|
| 30 | ## For maintainers
|
---|
| 31 |
|
---|
| 32 | ### How to publish a new release
|
---|
| 33 |
|
---|
| 34 | 1. On the `main` branch, bump the version number in `package.json`:
|
---|
| 35 |
|
---|
| 36 | ```sh
|
---|
| 37 | npm version patch -m 'Release v%s'
|
---|
| 38 | ```
|
---|
| 39 |
|
---|
| 40 | Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).
|
---|
| 41 |
|
---|
| 42 | Note that this produces a Git commit + tag.
|
---|
| 43 |
|
---|
| 44 | 1. Push the release commit and tag:
|
---|
| 45 |
|
---|
| 46 | ```sh
|
---|
| 47 | git push && git push --tags
|
---|
| 48 | ```
|
---|
| 49 |
|
---|
| 50 | Our CI then automatically publishes the new release to npm.
|
---|
| 51 |
|
---|
| 52 | ## Author
|
---|
| 53 |
|
---|
| 54 | | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
---|
| 55 | |---|
|
---|
| 56 | | [Mathias Bynens](https://mathiasbynens.be/) |
|
---|
| 57 |
|
---|
| 58 | ## License
|
---|
| 59 |
|
---|
| 60 | _unicode-property-aliases-ecmascript_ is available under the [MIT](https://mths.be/mit) license.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.