{"id":16642085,"url":"https://github.com/make-github-pseudonymous-again/set-alarm","last_synced_at":"2025-10-30T11:31:30.490Z","repository":{"id":37175923,"uuid":"339987463","full_name":"make-github-pseudonymous-again/set-alarm","owner":"make-github-pseudonymous-again","description":":alarm_clock: Call a Function on a given Date","archived":false,"fork":false,"pushed_at":"2024-04-14T10:35:12.000Z","size":2095,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T12:01:42.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://make-github-pseudonymous-again.github.io/set-alarm","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/make-github-pseudonymous-again.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-02-18T08:45:02.000Z","updated_at":"2024-04-17T23:25:16.996Z","dependencies_parsed_at":"2023-09-26T07:51:33.059Z","dependency_job_id":"4ba7fa86-d209-41fb-94d9-c5615cff6b02","html_url":"https://github.com/make-github-pseudonymous-again/set-alarm","commit_stats":{"total_commits":324,"total_committers":6,"mean_commits":54.0,"dds":0.5030864197530864,"last_synced_commit":"76e04910860d48a2e317843cdaf45b59e553473b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-github-pseudonymous-again%2Fset-alarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-github-pseudonymous-again%2Fset-alarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-github-pseudonymous-again%2Fset-alarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-github-pseudonymous-again%2Fset-alarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/make-github-pseudonymous-again","download_url":"https://codeload.github.com/make-github-pseudonymous-again/set-alarm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238960312,"owners_count":19559242,"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-10-12T07:48:50.514Z","updated_at":"2025-10-30T11:31:25.145Z","avatar_url":"https://github.com/make-github-pseudonymous-again.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":":alarm_clock: [set-alarm](https://make-github-pseudonymous-again.github.io/set-alarm)\n==\n\nCall a `Function` on a given `Date`.\nThe API tries to mimic [the `setTimeout` API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) as best as possible.\nSee [docs](https://make-github-pseudonymous-again.github.io/set-alarm/index.html).\n\n```js\nimport {\n\tsetAlarm,\n\tclearAlarm,\n\tAlarm\n} from 'set-alarm';\n\nconst firstOfApril2021AtNoonZuluTime = new Date('2021-04-01T12:00Z');\n\n// Set an alarm\nconst alarm = setAlarm(() =\u003e {\n\tconsole.debug(new Date() - firstOfApril2021AtNoonZuluTime);\n}, firstOfApril2021AtNoonZuluTime);\n\nalarm instanceof Alarm; // true\n\n// Two scenarios:\n//  - if date is in the future: should trigger at or just after the date, logging a small nonnegative number\n//  - if date is in the past: will trigger anyway logging a possibly large positive number\n// It is up to you to ignore alarms for past dates (similar to `setTimeout(..., -2389324)`).\n\n// OR Unenroll the callback (and the alarm will not trigger)\nclearAlarm(alarm); // undefined\n```\n\n[![License](https://img.shields.io/github/license/make-github-pseudonymous-again/set-alarm.svg)](https://raw.githubusercontent.com/make-github-pseudonymous-again/set-alarm/main/LICENSE)\n[![Version](https://img.shields.io/npm/v/set-alarm.svg)](https://www.npmjs.org/package/set-alarm)\n[![Tests](https://img.shields.io/github/actions/workflow/status/make-github-pseudonymous-again/set-alarm/ci.yml?branch=main\u0026event=push\u0026label=tests)](https://github.com/make-github-pseudonymous-again/set-alarm/actions/workflows/ci.yml?query=branch:main)\n[![Dependencies](https://img.shields.io/librariesio/github/make-github-pseudonymous-again/set-alarm.svg)](https://github.com/make-github-pseudonymous-again/set-alarm/network/dependencies)\n[![GitHub issues](https://img.shields.io/github/issues/make-github-pseudonymous-again/set-alarm.svg)](https://github.com/make-github-pseudonymous-again/set-alarm/issues)\n[![Downloads](https://img.shields.io/npm/dm/set-alarm.svg)](https://www.npmjs.org/package/set-alarm)\n\n[![Code issues](https://img.shields.io/codeclimate/issues/make-github-pseudonymous-again/set-alarm.svg)](https://codeclimate.com/github/make-github-pseudonymous-again/set-alarm/issues)\n[![Code maintainability](https://img.shields.io/codeclimate/maintainability/make-github-pseudonymous-again/set-alarm.svg)](https://codeclimate.com/github/make-github-pseudonymous-again/set-alarm/trends/churn)\n[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/make-github-pseudonymous-again/set-alarm/main.svg)](https://codecov.io/gh/make-github-pseudonymous-again/set-alarm)\n[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/make-github-pseudonymous-again/set-alarm.svg)](https://codeclimate.com/github/make-github-pseudonymous-again/set-alarm/trends/technical_debt)\n[![Documentation](https://make-github-pseudonymous-again.github.io/set-alarm/badge.svg)](https://make-github-pseudonymous-again.github.io/set-alarm/source.html)\n[![Package size](https://img.shields.io/bundlephobia/minzip/set-alarm)](https://bundlephobia.com/result?p=set-alarm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmake-github-pseudonymous-again%2Fset-alarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmake-github-pseudonymous-again%2Fset-alarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmake-github-pseudonymous-again%2Fset-alarm/lists"}