Get an introduction into transpilers, Babel, and working in full ES2015 (formerly ES6) mode.
- [Instructor] Now that we've decided that…we want to have full ES2015 formerly ES6, support,…we're going to go ahead and control + z…and remove this Meaningless…and put it back to HelloWorld.…I'll copy this and replace that…and to have full ES2015 support we're actually…going to have to introduce what's called a transpiler.…A transpiler sits in the background…and compiles our JavaScript the way we like it…into a version that node is going to be more familiar with.…And the transpiler that we're going to use is called Babel.…
So let's return to our command prompt…and let's npm install --save-dev,…which means this is only required for people…that are actually developing on this platform.…And we want to install the Babel cli.…Now we want to install support for ES2015…and I'll say npm install --save-dev again…but this time we're going to install…babel-preset-es2015.…
Now returning to our project,…I need to go to my package.json folder…and I'm going to need to add an entry in here for Babel.…So just below scripts on line eight…
Released
12/14/2018- Installing and publishing Node.js packages
- Defining classes in Node.js
- Building a web API with Express and Node.js
- Unit testing in Node.js
- Continuous integration
Share this video
Embed this video
Video: Using Babel to transpile from ES6 (ES2015)