From the course: Learn JavaScript: Write Modern Code with JavaScript ESNext

Unlock this course with a free trial

Join today to access over 25,000 courses taught by industry experts.

Use Babel to transpile code

Use Babel to transpile code

- So at this point we have our node script all written out, but there's still one thing we have left to do before we can run it. You see, if we try and run our script now, which we should be able to do by typing node source slash index.JS with two command line arguments and hitting enter, we see that we get an error. And the reason we get this error is because we wrote all our code using ES six syntax, which no JS currently does not support out of the box. So in order to actually run our code, we're going to use a tool called Babble, which takes the code that we wrote in ES six syntax, and trans compiles it to a syntax that no JS can actually execute. So in order to do that, we have to actually install a few Babble packages into our project. And the way that we do this, and in fact, the way that we install all NPM packages into our project, is by saying NPM install, and then the name of the packages that we want to install. Now in our case, there's three main packages we're going to…

Contents