JSPM

  • Created
  • Published
  • Downloads 8673836
  • Score
    100M100P100Q32752F

Compile Unicode property escapes in Unicode regular expressions to ES5.

Package Exports

  • @babel/plugin-proposal-unicode-property-regex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@babel/plugin-proposal-unicode-property-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@babel/plugin-proposal-unicode-property-regex

Compile Unicode property escapes (\p{…} and \P{…}) in Unicode regular expressions to ES5 or ES6 that works in today’s environments.

Note: the Unicode property escape syntax is non-standard and may or may not reflect what eventually gets specified.

Here’s an online demo.

Installation

npm install @babel/plugin-proposal-unicode-property-regex

Usage

.babelrc

{
  "plugins": ["@babel/proposal-unicode-property-regex"]
}

Via CLI

babel --plugins @babel/@babel/proposal-unicode-property-regex script.js

Via Node.js API

require("@babel/core").transform(code, {
  "plugins": ["@babel/proposal-unicode-property-regex"]
});

To transpile to ES6/ES2015:

require("@babel/core").transform(code, {
  "plugins": [
    ["@babel/proposal-unicode-property-regex", { "useUnicodeFlag": true }]
  ]
});

Author

twitter/mathias
Mathias Bynens