Install the latest presets
yarn add --dev babel-preset-latest
Create
.babelrcand add the following{ "presets": ["latest"] }
Run your script
npx babel-node yourscript.js
Use babel latest presetsOr in your package.json file add
- Install the latest presets
yarn add --dev"scripts": babel-preset-latest - Create
.babelrcand add the following
{ "presets""start": ["latest"] } - Run your script
npx babel"babel-node yourscriptindex.jsjs" } - Or in your package.json file add
"scripts": { "start": "babel-node index.js" }