A Babel preset that automatically enables parsing support for all ECMAScript proposals and syntax features that are currently supported by the active Node.js version. Version 1.2.0 is the latest stable release, updated periodically to align with Node.js release cycles. This preset simplifies configuration by detecting the Node.js version at runtime and applying the appropriate Babel parser plugins, eliminating the need to manually specify plugins for each new syntax feature. It is designed for use with @babel/core v7 or v8 and is specifically tailored for projects targeting the local Node.js environment, such as tools, scripts, or libraries that rely on the latest syntax without transpilation. Key differentiators include zero configuration, automatic updates with Node.js versions, and support for features like import attributes and top-level await.
npm install babel-preset-current-node-syntaxVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup to transpile modern Node.js syntax without manual plugin configuration using the preset.
Remove any options passed to the preset array.
Use require() or set NODE_OPTIONS='--experimental-require-module' in Node 22+.
Use @babel/preset-env with targets set to older Node versions if transpilation is needed for compatibility.
Ensure consistent Node version across environments or use a fixed preset (e.g., @babel/preset-env with specified targets).
Install the preset as a dev dependency: npm install --save-dev babel-preset-current-node-syntax
Use require() in babel.config.js or ensure babel is configured to handle CJS modules.
Add 'babel-preset-current-node-syntax' to the presets array in babel.config.js and run Babel with --presets flag if using CLI.