Firebase launched its beta release of Cloud Functions for Firebase which is similar to using of Cloud Functions on Google Cloud Platform.
Cloud Functions is a hosted, private, and scalable Node.js environment where you can run JavaScript code. Firebase SDK for Cloud Functions integrates the Firebase platform by letting you write code that responds to events and invokes functionality exposed by other Firebase features.