This enables the use of Unicode property escapes of the form `\p{…}` and `\P{…}` in regular expressions with the `u` flag enabled.
More info: https://mathiasbynens.be/notes/es-unicode-property-escapes
Proposal: https://github.com/mathiasbynens/es-regexp-unicode-property-escapes
Plugin: https://github.com/mathiasbynens/babel-plugin-transform-unicode-property-regex
babel-preset-stage-2
Babel preset for stage 2 plugins.
Install
npm install --save-dev babel-preset-stage-2
Usage
Via .babelrc (Recommended)
.babelrc
{
"presets": ["stage-2"]
}
Via CLI
babel script.js --presets stage-2
Via Node API
require("babel-core").transform("code", {
presets: ["stage-2"]
});