@babel/plugin-transform-unicode-escapes

NOTE: This plugin is included in @babel/preset-env

Compile ES2015 Unicode escapes to ES5

Example

In

  1. var \u{1d49c} = "\u{Babe1}";
  2. console.log(\u{1d49c});

Out

  1. var _ud835_udc9c = "\uDAAA\uDFE1";
  2. console.log(_ud835_udc9c);

Installation

  1. npm install --save-dev @babel/plugin-transform-unicode-escapes

Usage

  1. {
  2. "plugins": ["@babel/plugin-transform-unicode-escapes"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-transform-unicode-escapes

Via Node API

  1. require("@babel/core").transformSync("code", {
  2. plugins: ["@babel/plugin-transform-unicode-escapes"],
  3. });