As someone new to Node, should I use Babel or plain ES6 in Node v5?

151 views
Skip to first unread message

Willem Odendaal

unread,
Nov 4, 2015, 2:22:25 PM11/4/15
to nodejs
Node seems to be evolving rapidly, and I wonder what the community sentiment is around using transpilers at the moment.

As someone just starting out, is it a good idea to use a transpiler like Babel to get most ES6 features? Or is the community moving towards using the ES6 features supported in Node v5?

Just trying to get an idea of the preferred practice at the moment, before I head off in the wrong direction.

Thanks.

Zlatko

unread,
Nov 5, 2015, 10:28:21 AM11/5/15
to nodejs
This depends a little on what you plan to do with your node-fu.

If you plan to learn a bit more, maybe work on your personal projects or start something new in a new company, then I think you should just start with Node 4 (the TLS version) and write "native" ES6. Even if you're just learning at the moment, you can still go on and learn, because most of the time the transpiler is set up only once, at the project start, and then you forget about it.

And if you plan to contribute to older codebases etc, you can just add the transpile step later, and you're done.

But if you plan to go work in a company already using node, or publishing libraries that you expect will be widely used, be aware that a lot of companies still use Node 0.10 and Node 0.12, and those apps will be around for a long time. So working on something like that might even mandate the use of ES5 only, without even transpilation.

So TL;DR would be, just write ES6, worry about transpilation when you have to.

Willem Odendaal

unread,
Nov 6, 2015, 1:21:59 AM11/6/15
to nodejs
Thanks Zlatko, much appreciated :)

This is just for my own benefit, so I'll do as you suggest an use Node 4 with "native" ES6.

PS: looks like modules aren't supported yet. Am I right?  I don't even see Modules on the compatibility page: https://kangax.github.io/compat-table/es6/ 
Reply all
Reply to author
Forward
0 new messages