babel-plugin-transform-unicode-property-regex

Compile Unicode property escapes in Unicode regular expressions to ES5.

Use @babel/plugin-proposal-unicode-property-regex instead.
Last updated 9 years ago by mathias .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-unicode-property-regex 
SYNC missed versions from official npm registry.

babel-plugin-transform-unicode-property-regex Build status

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-transform-unicode-property-regex

Usage

Via .babelrc (recommended)

.babelrc

{
  "plugins": ["transform-unicode-property-regex"]
}

Via CLI

$ babel --plugins transform-unicode-property-regex script.js

Via Node.js API

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

To transpile to ES6/ES2015:

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

Author

twitter/mathias
Mathias Bynens

License

This code is available under the MIT license.

Current Tags

  • 2.0.5                                ...           latest (9 years ago)

7 Versions

  • 2.0.5 [deprecated]           ...           9 years ago
  • 2.0.4 [deprecated]           ...           9 years ago
  • 2.0.3 [deprecated]           ...           9 years ago
  • 2.0.2 [deprecated]           ...           9 years ago
  • 2.0.1 [deprecated]           ...           9 years ago
  • 2.0.0 [deprecated]           ...           9 years ago
  • 1.0.0 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 5
Last Day 1
Last Week 3
Last Month 7
Dependencies (2)
Dev Dependencies (6)

Copyright 2013 - present © cnpmjs.org | Home |