Deploy from this project

$ git clone https://github.com/mydream19/firebase_moderate_image.git
$ cd firebase_moderate_image
$ firebase login

$ cd functions
$ npm install
$ cd ..

$ firebase deploy --only functions

You can following this to create the project by yourself

Project Started From Here

Get started: write and deploy your first functions

$ npm install -g firebase-tools
$ firebase login

$ firebase init

? Select a default Firebase project for this directory:
profile-final-test (Profile-FINAL-TEST)

? What language would you like to use to write Cloud Functions?
Javascript

? Do you want to use ESLint to catch probable bugs and enforce style? (y/N) y

? Do you want to install dependencies with npm now? (Y/n) y

Cofiguration

  1. Change ecmaVersion to 8 from 6 in functions/.eslintrc.json line 4.
  2. Add node engine in package.json
"engines": {
  "node": "8"
},

Follow this tutorial

9. Images moderation

Add a following code in function/index.js at line 37.

return null;

Deploy

$ firebase deploy --only functions

Test

Go to the Firebase Console Storage tab and upload an image that contains adult or violent content. After a short time the image will be replaced by a blurred version of itself.
You can check with this image flesh eating Zombie