ES6 usage requires --harmony
flag in node v0.12.3.
Is there a way to do so for an aws lambda function?
These answers are a bit out of date. AWS announced support for Node.js 4.3.2 runtime in April 2016. 4.3.2 supports ES6. It is also completely backwards compatible. More details available here:
https://aws.amazon.com/blogs/compute/node-js-4-3-2-runtime-now-available-on-lambda/