Skip to content

Instantly share code, notes, and snippets.

@jthegedus
Last active November 29, 2017 11:46
Show Gist options
  • Save jthegedus/938063ac831cf8cf7175c6b356e2299d to your computer and use it in GitHub Desktop.
Save jthegedus/938063ac831cf8cf7175c6b356e2299d to your computer and use it in GitHub Desktop.
ES6+ in Cloud Functions for Firebase - preset-2015
// input - using CommonJS module syntax
const functions = require('firebase-functions')
module.exports.helloWorld = functions.https.onRequest((req, res) => {
let world = `from Babelified Cloud Functions!`;
res.status(200).send(`Hello ${world}`);
})
// Babel output - with Babel REPL settings:
// * preset-es2015
'use strict';
var functions = require('firebase-functions');
module.exports.helloWorld = functions.https.onRequest(function (req, res) {
var world = 'from Babelified Cloud Functions!';
res.status(200).send('Hello ' + world);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment