Can we use the ES6 class syntax in AWS Lambda?

Viewed 14803

I would like to use the ES6 class syntax in AWS Lambda using Node 6.10, but I cannot get it to work:

class widget {
    constructor(event, context, callback) {
        callback(null, `all seems well!`);
    }
}

// module.exports.handler = widget; // "Process exited before completing request"
module.exports.handler = new widget(); // "callback is not a function"

Has anyone had success with using the class syntax? The class constructor does not get seen as a handler function apparently.

2 Answers
Related