babel-plugin-transform-charcodes
v0.2.0
Published
Replace charcodes AOT
Downloads
7,907
Maintainers
Readme
babel-plugin-transform-charcodes
Replace charcodes AOT
Examples
Constants
in:
import * as charcodes from "charcodes"
charcodes.space
out:
32
Functions
in:
import * as charcodes from "charcodes"
(charcodes.isDigit(1))
out:
(function isDigit(code) {
return code >= 48 && code <= 57;
}(1))
Installation
npm install --save-dev babel-plugin-transform-charcodes
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["transform-charcodes"]
}
Via CLI
babel --plugins transform-charcodes script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["transform-charcodes"]
});