{"id":15646163,"url":"https://github.com/doowb/firebase-cron","last_synced_at":"2025-07-24T05:37:04.786Z","repository":{"id":57236581,"uuid":"48885475","full_name":"doowb/firebase-cron","owner":"doowb","description":"Store and run cron jobs with firebase.","archived":false,"fork":false,"pushed_at":"2018-05-17T14:42:28.000Z","size":24,"stargazers_count":50,"open_issues_count":6,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-30T12:17:57.332Z","etag":null,"topics":["cron","firebase","firebase-cron","firebase-queue"],"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/doowb.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":"2016-01-01T18:07:53.000Z","updated_at":"2024-02-05T23:34:22.000Z","dependencies_parsed_at":"2022-08-23T15:50:49.825Z","dependency_job_id":null,"html_url":"https://github.com/doowb/firebase-cron","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/doowb/firebase-cron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffirebase-cron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffirebase-cron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffirebase-cron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffirebase-cron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/firebase-cron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffirebase-cron/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796910,"owners_count":23985495,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cron","firebase","firebase-cron","firebase-queue"],"created_at":"2024-10-03T12:11:40.037Z","updated_at":"2025-07-24T05:37:04.764Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","readme":"# firebase-cron [![NPM version](https://img.shields.io/npm/v/firebase-cron.svg?style=flat)](https://www.npmjs.com/package/firebase-cron)\n\n\u003e Store and run cron jobs with firebase.\n\n## Install\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save firebase-cron\n```\n\n## Usage\n\n```js\nvar Cron = require('firebase-cron');\n```\n\n## API\n\n### [Cron](index.js#L33)\nMain `Cron` class for creating a new instance to manage cron jobs.\n\n**Params**\n\n* `ref` **{Object}**: Instance of a [firebase][] reference pointing to the root of a [firebase][].    \n* `queue` **{Object}**: Instance of a [firebase][] refernece pointing to a [firebase-queue][].    \n* `options` **{Object}**: Options specifying where the cron jobs are stored.    \n* `options.endpoint` **{String}**: Specific endpoint relative to the `ref` where the cron jobs are stored (defaults to `jobs`).    \n* `options.interval` **{Number}**: Optional interval in milliseconds to use when calling `.run` (defaults to 1000).    \n\n**Example**\n\n```js\nconst Firebase = require('firebase');\nconst ref = new Firebase('https://{your-firebase}.firebaseio.com');\nconst queueRef = new Firebase('https://{your-firebase}.firebaseio.com/queue');\nconst options = {endpoint: 'jobs'};\n\nconst cron = new Cron(ref, queueRef, options);\n```\n\n### [.addJob](index.js#L73)\n\nAdd a new cron job.\n\n**Params**\n\n* `name` **{String}**: Name of the cron job.    \n* `pattern` **{String}**: Cron job pattern. See [cron job patterns](http://crontab.org/) for specifics.    \n* `data` **{Object}**: Data to be pushed onto the [firebase-queue][] when job is run.    \n* `returns` **{Promise}**: Returns a promise that is resolved when the job has been updated.  \n\n### [.updateJob](index.js#L93)\n\nUpdate a cron job.\n\n**Params**\n\n* `name` **{String}**: Name of the cron job.    \n* `pattern` **{String}**: Cron job pattern. See [cron job patterns](http://crontab.org/) for specifics.    \n* `data` **{Object}**: Data to be pushed onto the [firebase-queue][] when job is run.    \n* `returns` **{Promise}**: Returns a promise that is resolved when the job has been added.  \n\n### [.deleteJob](index.js#L111)\n\nRemove a cron job.\n\n**Params**\n\n* `name` **{String}**: Name of the cron job.    \n* `returns` **{Promise}**: Returns a promise that is resolved when the job has been removed.  \n\n### [.getJob](index.js#L123)\n\nGet a cron job.\n\n**Params**\n\n* `name` **{String}**: Name of the cron job.    \n* `returns` **{Promise}**: Returns a promise that is resolved with the job.  \n\n### [.getJobs](index.js#L135)\n\nGet all of the cron jobs.\n\n* `returns` **{Promise}**: Returns a promise that is resolved with all of the jobs.  \n\n### [.waitingJobs](index.js#L148)\n\nGet all of the scheduled/waiting jobs.\n\n* `returns` **{Promise}**: Returns a promise that is resolved with the waiting jobs.  \n\n### [.run](index.js#L163)\n\nStart running the cron manager.\n\n**Params**\n\n* `cb` **{Function}**: Callback function that is called each time manager checks for jobs to run.    \n* `error` **{Function}**: Callback function that is called if an error occurrs.    \n\n## Related projects\n- [firebase-queue](https://www.npmjs.com/package/firebase-queue): A fault-tolerant, multi-worker, multi-stage job pipeline built on Firebase | [homepage](https://github.com/firebase/firebase-queue \"A fault-tolerant, multi-worker, multi-stage job pipeline built on Firebase\")\n- [firebase](https://www.npmjs.com/package/firebase): Firebase JavaScript library for web and Node.js | [homepage](https://firebase.google.com/ \"Firebase JavaScript library for web and Node.js\")\n\n## Running tests\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n## Author\n**Brian Woodward**\n\n+ [github/doowb](https://github.com/doowb)\n+ [twitter/doowb](https://twitter.com/doowb)\n\n## License\nCopyright © 2018, [Brian Woodward](https://github.com/doowb).\nMIT\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 17, 2018._\n\n[firebase]: https://www.firebase.com/\n[firebase-queue]: https://github.com/firebase/firebase-queue\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Ffirebase-cron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Ffirebase-cron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Ffirebase-cron/lists"}