Using ES6 on Electron app with io.js

293 Views Asked by At

I am writing cross-platform application with electron. I want to be enable ES6 arrow-function feature in main process using like iojs --harmony_arrow_functions.

Electron already installed successfully on io.js 3.1.0 .

How I can do it with io.js?

2

There are 2 best solutions below

0
On BEST ANSWER

If you go to the electron releases, in major/minor release notes you can see which version of nodejs it is using: https://github.com/atom/electron/releases/tag/v0.36.0

  • Upgrade to Node 5.1.1.

I'm not totally sure which version of node arrow functions first became available but I can confirm that they are available in the latest version, 5.2.0.

Relatedly, to easily switch between versions of node I highly recommend using nvm: https://github.com/creationix/nvm

That way you can easily switch to match updated versions of electron and you can automate it quite easily as well.

0
On

Electron was switched to nodejs, currently 5.1 see here - https://github.com/atom/electron/releases/tag/v0.36.0