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 in Others by code_ninja
• 6,220 points
115 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 by ArchanaNagur
• 2,270 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 in Others by sunshine
• 1,240 points
69 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 in Others by Jobin
56 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 in Others by sunshine
• 1,240 points
268 views
+2 votes
2 answers
0 votes
1 answer

How to send Bitcoins with node.js?

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

answered Jul 20, 2018 in Blockchain by Christine
• 15,790 points
468 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,130 points
56 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
• 67,660 points
38 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 in Others by ArchanaNagur
• 2,270 points
47 views
0 votes
1 answer

Why is MongoDB associated with Node.js?

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

answered Jul 18 in Others by ArchanaNagur
• 2,270 points
41 views