Socket
Socket
Sign inDemoInstall

babel-plugin-transform-es2015-unicode-regex

Package Overview
Dependencies
13
Maintainers
6
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-unicode-regex

Compile ES2015 Unicode regex to ES5


Version published
Maintainers
6
Weekly downloads
1,377,997
decreased by-7.33%

Weekly downloads

Readme

Source

babel-plugin-transform-es2015-unicode-regex

Compile ES2015 unicode regex to ES5

Example

In

var string = "foo💩bar";
var match = string.match(/foo(.)bar/u);

Out

var string = "foo💩bar";
var match = string.match(/foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))bar/);

Installation

npm install --save-dev babel-plugin-transform-es2015-unicode-regex

Usage

.babelrc

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

Via CLI

babel --plugins transform-es2015-unicode-regex script.js

Via Node API

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

Keywords

FAQs

Last updated on 07 Apr 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc