{"id":20877694,"url":"https://github.com/dafrok/public-interval","last_synced_at":"2026-04-19T20:37:30.182Z","repository":{"id":65477399,"uuid":"50979879","full_name":"Dafrok/public-interval","owner":"Dafrok","description":"Create a public interval handler to manage a group of processors.","archived":false,"fork":false,"pushed_at":"2016-02-03T16:18:20.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-20T13:20:04.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Dafrok.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}},"created_at":"2016-02-03T06:41:30.000Z","updated_at":"2016-02-03T16:17:27.000Z","dependencies_parsed_at":"2023-01-25T06:35:11.906Z","dependency_job_id":null,"html_url":"https://github.com/Dafrok/public-interval","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/Dafrok%2Fpublic-interval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dafrok%2Fpublic-interval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dafrok%2Fpublic-interval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dafrok%2Fpublic-interval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dafrok","download_url":"https://codeload.github.com/Dafrok/public-interval/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243251495,"owners_count":20261217,"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":[],"created_at":"2024-11-18T06:58:17.308Z","updated_at":"2025-12-24T20:15:09.089Z","avatar_url":"https://github.com/Dafrok.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# public-interval.js\n## Intro\nCreate a public interval handler to manage a group of processors.\n\n## Install\n```\n$ npm install public-interval\n```\n\n## Usage\n```javascript\nimport PublicInterval from 'public-interval'\nlet pi = new PublicInterval()\npi.setProcessor('my-processor', function () {\n    console.log('My processor is running.')\n})\npi.go()\n```\n\n## Option\n- timer {number} Interval time of this handler.\n- processor {object} Initial processors of this handler.\n- autorun {boolean} Whether run this handler when initialized.\n\n\n## API\n### pi.go\n- description\n    - Start this interval handler.\n\n\n### pi.stop\n- description\n    - Stop this interval handler.\n\n### pi.setProcessor\n- description\n    - Set a new processor in this interval handler.\n- param\n    - name(optional) {string} The name of this processor. It's a unique value.\n    - fn {function} The processor.\n\n### pi.removeProcessor\n- description\n    - Remove a processor in this interval by name.\n- param\n    - name {string} The name of a processor which works in this interval handler.\n\n### pi.setTimer\n- description\n    - Set interval time for this interval handler.\n- param\n    - time {number} The interval time of this interval handler.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafrok%2Fpublic-interval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdafrok%2Fpublic-interval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafrok%2Fpublic-interval/lists"}