Skip to main content
More readable
Source Link
Jonathan H
  • 8k
  • 5
  • 55
  • 84
  1. Install the latest presets

    yarn add --dev babel-preset-latest

  2. Create .babelrc and add the following

    { "presets": ["latest"] }

  3. 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 .babelrc and 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" }

Use babel latest presets

  • Install the latest presets
yarn add --dev babel-preset-latest 
  • Create .babelrc and add the following
{   "presets": ["latest"] } 
  • Run your script
npx babel-node yourscript.js 
  • Or in your package.json file add

"scripts": { "start": "babel-node index.js" }

  1. Install the latest presets

    yarn add --dev babel-preset-latest

  2. Create .babelrc and add the following

    { "presets": ["latest"] }

  3. Run your script

    npx babel-node yourscript.js

Or in your package.json file add

"scripts": { "start": "babel-node index.js" } 

Use babel latest presets

  • Install the latest presets
yarn add --dev babel-preset-latest 
  • Create .babelrc and add the following
{ "presets": ["latest"] } 
  • Run your script
npx babebabel-node yourscript.js 
  • Or in your package.json file add

"scripts": { "start": "babel-node index.js" }

Use babel latest presets

  • Install the latest presets
yarn add --dev babel-preset-latest 
  • Create .babelrc and add the following
{ "presets": ["latest"] } 
  • Run your script
npx babe-node yourscript.js 

Use babel latest presets

  • Install the latest presets
yarn add --dev babel-preset-latest 
  • Create .babelrc and add the following
{ "presets": ["latest"] } 
  • Run your script
npx babel-node yourscript.js 
  • Or in your package.json file add

"scripts": { "start": "babel-node index.js" }

Source Link
Jerome Anthony
  • 8.1k
  • 2
  • 44
  • 32

Use babel latest presets

  • Install the latest presets
yarn add --dev babel-preset-latest 
  • Create .babelrc and add the following
{ "presets": ["latest"] } 
  • Run your script
npx babe-node yourscript.js