@babel/plugin-syntax-numeric-separator
note
Syntax only
It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-transform-numeric-separator to both parse and transform this syntax.
Installation
- npm
- Yarn
- pnpm
npm install --save-dev @babel/plugin-syntax-numeric-separator
yarn add --dev @babel/plugin-syntax-numeric-separator
pnpm add --save-dev @babel/plugin-syntax-numeric-separator
Usage
With a configuration file (Recommended)
babel.config.json
{
"plugins": ["@babel/plugin-syntax-numeric-separator"]
}
Via CLI
Shell
babel --plugins @babel/plugin-syntax-numeric-separator script.js
Via Node API
JavaScript
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-syntax-numeric-separator"]
});