Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between babel-cli and @babel/cli?

What is the difference between @babel/node and babel-node?
I did yarn add babel-node --dev but I had error. So I did yarn add @babel/node --dev, it worked. What is the meaning of @?

like image 526
brouk.develop Avatar asked May 09 '19 08:05

brouk.develop


People also ask

What is Babel CLI?

Babel comes with a built-in CLI which can be used to compile files from the command line. In addition, various entry point scripts live in the top-level package at @babel/cli/bin . There is a shell-executable utility script, babel-external-helpers. js , and the main Babel cli script, babel.

How do I know what version of Babel I have Mac?

You can also check the version of babel-cli by finding the babel-cli folder in node_modules and looking at the version property of the package. json that is at the base of that folder. If babel-cli was installed globally via -g flag of npm install , you could check the version by executing command babel --version .

Why Babel is used in Node JS?

Babel is a JavaScript compiler Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.

Is Babel needed for node JS?

If you've been active as a Node. js developer, or even dabbled in front-end libraries like React or Vue. js, then there's no doubt that you've likely run across Babel.


1 Answers

The @ signifies the usage of an "npm scope":

https://docs.npmjs.com/about-scopes

It's basically a way to avoid name clashing, so we could both own modules @cdbrouk/foo and @jedrichards/foo. Babel moved to using the @babel scope a while ago, so the @babel/... modules are the correct ones to use.

like image 58
Jed Richards Avatar answered Oct 17 '22 23:10

Jed Richards