{"id":26477758,"url":"https://github.com/ecronix/functions-loader","last_synced_at":"2026-04-14T00:31:26.870Z","repository":{"id":256269743,"uuid":"854772264","full_name":"ecronix/functions-loader","owner":"ecronix","description":"A tool to load firebase functions directly from files","archived":false,"fork":false,"pushed_at":"2024-09-09T19:18:45.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-18T15:43:14.434Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecronix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T18:47:22.000Z","updated_at":"2024-09-09T19:18:48.000Z","dependencies_parsed_at":"2024-09-09T23:49:43.455Z","dependency_job_id":"05ebbc9d-4731-4241-8800-0ad9ee3bb442","html_url":"https://github.com/ecronix/functions-loader","commit_stats":null,"previous_names":["ecronix/functions-loader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ecronix/functions-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecronix%2Ffunctions-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecronix%2Ffunctions-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecronix%2Ffunctions-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecronix%2Ffunctions-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecronix","download_url":"https://codeload.github.com/ecronix/functions-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecronix%2Ffunctions-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31776858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T00:11:49.126Z","status":"ssl_error","status_checked_at":"2026-04-14T00:10:29.837Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-03-20T00:53:09.820Z","updated_at":"2026-04-14T00:31:26.850Z","avatar_url":"https://github.com/ecronix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# functions-loader\n\n`functions-loader` is a utility package designed to automatically load Firebase Cloud Functions from files and folders within the `functions` directory. This simplifies the process of organizing and deploying your cloud functions by dynamically importing them based on the file structure. It specifically loads files with the `.f.js` extension.\n\n## Installation\n\nTo install `functions-loader`, you can use npm or yarn:\n\n## Usage\n\nTo use `functions-loader`, you need to require it in your `index.js` or `main.js` file where you initialize your Firebase functions. The package will automatically load all functions from the `functions` directory that have the `.f.js` extension.\n\n### Example\n\n1. **Create your functions directory structure:**\n\n   ```\n   functions/\n   ├── index.js\n   ├── helloWorld.f.js\n   └── user/\n       └── createUser.f.js\n   ```\n\n2. **Initialize `functions-loader` in your `index.js`:**\n\n   ```javascript\n   // functions/index.js\n   const { loadFunctions } = require(\"firebase-function-tools-preview\");\n\n   // Load all functions from the 'functions' directory\n   loadFunctions(__dirname, exports, true);\n   ```\n\n3. **Define your cloud functions in separate files with the `.f.js` extension:**\n\n   ```javascript\n   // functions/helloWorld.f.js\n   const functions = require(\"firebase-functions\");\n\n   module.exports = {\n     helloWorld: functions.https.onRequest((request, response) =\u003e {\n       response.send(\"Hello, World!\");\n     }),\n   };\n   ```\n\n   ```javascript\n   // functions/user/createUser.f.js\n   const functions = require(\"firebase-functions\");\n\n   module.exports = {\n     createUser: functions.auth.user().onCreate((user) =\u003e {\n       // Handle user creation\n     }),\n   };\n   ```\n\n### Demo\n\nYou can find a complete example of how to use `functions-loader` in the `demo` folder of this repository. The demo includes a sample project structure and demonstrates how to set up and use the package to load Firebase Cloud Functions.\n\nWith this setup, `functions-loader` will automatically import and register all the functions defined in the `functions` directory and its subdirectories that have the `.f.js` extension.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecronix%2Ffunctions-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecronix%2Ffunctions-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecronix%2Ffunctions-loader/lists"}