How to automatize current ES6 Javasript file tranpile into ES5 with Babel and Atom-Script package

Requirements

https://atom.io/ Atom Editor
https://atom.io/packages/script Install Script Package
https://nodejs.org/en/ Nodejs (prefer latest one)

Once installation completed, open your project with atom and install this packages with npm (selected light-green texts)



1- Create  ECMA6 standart javascript file. You can look at ECMA6 features from this site

2- While javasript file open, press shift-ctrl-alt-o (windows) / shift-cmd-i (OSX) now we will define a new atom-script profile 


Command:node
Command Arguments: node_modules\babel-cli\bin\babel.js {FILE_ACTIVE} --out-file out\{FILE_ACTIVE_NAME}

Before saving a profile, you can try your script with run button. If you want to open this interface again  press shift-ctrl-alt-o (windows) / shift-cmd-i (OSX) 


3- Click save as profile and enter a profiler name




4- Finally  run the code on your current javascript file. This will create ECMA5 javascript  file
   Macos                       Windows
shift-cmd-kshift-ctrl-alt-b

Yorumlar

  1. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here
    Thank you. Your blog was very helpful and efficient For Me,Thanks for Sharing the information Regards..!!..AngularJS Online Course India

    YanıtlaSil

Yorum Gönder

Bu blogdaki popüler yayınlar

22.06.2020 - 26.06.2020 arası işler

Asp.net RestSharp ile data post etmek

List Box Item içindeki elemanları aşağı veya yukarı taşımak