What is use of Babel in Node js

0 votes
Node.js Makes use of babel, What is it ? and why do Node.js Need it?
Jul 2, 2019 in Others by code_ninja
• 6,300 points
2,391 views

1 answer to this question.

0 votes

  • Node.js is a runtime environment  which let us to use javascript for server  side coding
  • JavaScript include different versions like ES5, ES6, ES7 and more 
  • Every browser do support ES5not all browsers so support ES6
  • ES6 has better and presized syntaxes then ES5 which helps the developers to build the codes with ease 
  • To make the browser support ES6 it is necessary to perform transpilation of code to ES5
  • Transpilation is a process of transforming any the code in a language that has a similar level of abstraction. A transpiler is used by javascript to convert an ES6 code to ES5
  • BaBel is the most popular tool used for transpiling ES6 code to ES5 
  • Make use of this command to include babel in any application:

npm install @babel/core @babel/preset-env @babel/register babel-polyfill

  • Remember we need to create a .babelrc file, where we will set babel by passing the package @babel/preset-env to perform the required Transpilation
answered Jul 2, 2019 by ArchanaNagur
• 2,360 points

Related Questions In Others

+1 vote
1 answer

what is the difference between error and stderr in Node.js?

Error is an object created by Node.js to handle ...READ MORE

answered Jul 4, 2019 in Others by sunshine
• 1,300 points
2,394 views
0 votes
1 answer

What sort of testing is involved in functional testing?

The following types of testing are involved ...READ MORE

answered Feb 18, 2019 in Others by Jobin
621 views
0 votes
1 answer

Why do we use Body-parser in Node.js?

For understanding this first you need to ...READ MORE

answered May 20, 2019 in Others by sunshine
• 1,300 points
8,021 views
0 votes
1 answer

What is the purpose of the "role" attribute in HTML

roles were initially defined by XHTML but ...READ MORE

answered Feb 27, 2022 in Others by narikkadan
• 63,600 points
568 views
0 votes
1 answer

How to send Bitcoins with node.js?

This website https://blockr.io/tx/push will successfully do the ...READ MORE

answered Jul 20, 2018 in Blockchain by Christine
• 15,790 points
3,403 views
0 votes
1 answer

Running a childProcess as shell script with node.js server

Here's what I think, you could pass ...READ MORE

answered Aug 14, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
756 views
0 votes
1 answer

How to read the ETH value and other token values from an account?

You can do this eth.accounts shows you all known ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 69,220 points
852 views
+1 vote
1 answer

What is Node.js? I want a clear understanding about it.

Node.js is a runtime environment which allows ...READ MORE

answered Jun 17, 2019 in Others by ArchanaNagur
• 2,360 points
980 views
0 votes
1 answer

Why is MongoDB associated with Node.js?

Node.js is an open source server environment ...READ MORE

answered Jul 19, 2019 in Others by ArchanaNagur
• 2,360 points
3,311 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP