{"id":19724112,"url":"https://github.com/cerebral/firebase-functions-mock","last_synced_at":"2025-04-29T22:31:13.052Z","repository":{"id":57236598,"uuid":"94866751","full_name":"cerebral/firebase-functions-mock","owner":"cerebral","description":"Work locally with firebase functions","archived":false,"fork":false,"pushed_at":"2017-06-23T02:48:26.000Z","size":11,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-20T09:24:37.322Z","etag":null,"topics":["firebase","firebase-functions","functions"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cerebral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-20T08:15:46.000Z","updated_at":"2019-07-11T19:48:30.000Z","dependencies_parsed_at":"2022-08-23T16:20:18.963Z","dependency_job_id":null,"html_url":"https://github.com/cerebral/firebase-functions-mock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerebral%2Ffirebase-functions-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerebral%2Ffirebase-functions-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerebral%2Ffirebase-functions-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerebral%2Ffirebase-functions-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cerebral","download_url":"https://codeload.github.com/cerebral/firebase-functions-mock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251565805,"owners_count":21609980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firebase-functions","functions"],"created_at":"2024-11-11T23:24:33.604Z","updated_at":"2025-04-29T22:31:12.740Z","avatar_url":"https://github.com/cerebral.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firebase-functions-mock\nWork locally with firebase functions\n\n## Install\n\n`npm install firebase-functions-mock`\n\n## Supports\n\n- **onRequest** express app handling\n- **onWrite** database event handling\n- Mocks out auth and config\n- Runs static delivery of your public files folder\n\n## How to use\n*functions/index.js*\n```js\nconst firebase = require('firebase-admin');\nconst admin = firebase.initializeApp({\n  credential: firebase.credential.cert(JSON.parse(process.env.SERVICE_ACCOUNT)),\n  databaseURL: JSON.parse(process.env.FIREBASE_CONFIG).databaseURL,\n});\nlet functions = require('firebase-functions');\n\n// When in debug mode, override functions with the mock and\n// pass in the instance of \"admin\" and optional options\nif (process.env.NODE_ENV !== 'production') {\n  functions = require('firebase-functions-mock')(admin, {\n    config: process.env.FIREBASE_CONFIG,\n    port: 3001,\n    publicPath: 'public'\n  });\n}\n\nexports.app = functions.https.onRequest(require('./app'));\nexports.publish = functions.database.ref('articles/{uid}/{articleName}').onWrite(require('./publish'));\n```\n\n## Limitations\nThis project is in its initial state to build the [jsblog.io](https://www.jsblog.io) project. It has a lot of potential for improvements. Although contributions are already made, here are some things to look into:\n\n- Test more scenarios with **onWrite** usage\n\n## Get going\nTo get going with Firebase Functions I highly recommend using [this boilerplate](https://github.com/cerebral/firebase-functions-boilerplate) which has the whole workflow set up for you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerebral%2Ffirebase-functions-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcerebral%2Ffirebase-functions-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerebral%2Ffirebase-functions-mock/lists"}