lepu-test-platform-web/node_modules/babel-plugin-transform-es20...
zhangbo db3ebd0df0 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
..
lib 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
.npmignore 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
README.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
package.json 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00

README.md

babel-plugin-transform-es2015-literals

Compile ES2015 unicode string and number literals to ES5

Example

In

var b = 0b11; // binary integer literal
var o = 0o7; // octal integer literal
const u = 'Hello\u{000A}\u{0009}!'; // unicode string literals, newline and tab

Out

var b = 3; // binary integer literal
var o = 7; // octal integer literal
const u = 'Hello\n\t!'; // unicode string literals, newline and tab

Installation

npm install --save-dev babel-plugin-transform-es2015-literals

Usage

.babelrc

{
  "plugins": ["transform-es2015-literals"]
}

Via CLI

babel --plugins transform-es2015-literals script.js

Via Node API

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