Package Exports
- firebase-functions
- firebase-functions/lib/providers/https
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (firebase-functions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
firebase-functions
The firebase-functions package provides an SDK for defining Firebase Functions.
Installation
In your Firebase project's functions directory, run:
npm install firebase-functionsUsage
// functions/index.js
var functions = require('firebase-functions');
var notifyUsers = require('./notify-users');
exports.newPost = functions.database
.ref('/posts/{postId}')
.onWrite(function(event) {
// only execute function on creation
if (!event.data.previous.exists()) {
notifyUsers(event.data.val());
}
});