Even better, just npm install -g babel once on any machine you use. Then it's ready for any and every .js file.
Re:The Final ES2015 (ES6) Draft
by cholantesh on Wednesday June 17, 2015 @03:19PM
(#9734566)
Ours is a .NET shop and we don't have plans to update to VS2015 in the near future. Does this workflow suggest that, in order to take advantage of Babel, we will have to install npm on all our dev machines and servers?
dev machines yes.
Well I have to run it every time I edit a file, maybe you missed the second half of my steps, so I still need a watch mode thingy which means probably a build script like virtually everyone using Babel is doing.
Regardless, vi index.html is much simpler.
If you're just playing with code, here's a simpler workflow:
* npm install babel
* write file.js
* run `babel-node file.js`
Similar to your example, the only extra step here is installing babel. If it's excruciating, install it globally and save yourself forever.