0

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?

KiYugadgeter
  • 3,796
  • 7
  • 34
  • 74
  • the iojs team said that using the `--harmony_arrow_functions` flag "is highly discouraged unless for testing purposes". If this is for production I would recommend just using babel. If you ARE testing, ignore this. – Sam Eaton Sep 08 '15 at 01:13

2 Answers2

0

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

psulek
  • 4,308
  • 3
  • 29
  • 37
0

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.

justin.m.chase
  • 13,061
  • 8
  • 52
  • 100