vlad 6f123ff03e 18.07 | 6 éve | |
---|---|---|
.. | ||
lib | 6 éve | |
.npmignore | 6 éve | |
README.md | 6 éve | |
package.json | 6 éve |
Compile ES2015 unicode string and number literals to ES5
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
npm install --save-dev babel-plugin-transform-es2015-literals
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-es2015-literals"]
}
babel --plugins transform-es2015-literals script.js
require("babel-core").transform("code", {
plugins: ["transform-es2015-literals"]
});