{"id":16387406,"url":"https://github.com/arb/big-time","last_synced_at":"2025-03-21T02:31:26.481Z","repository":{"id":32911492,"uuid":"36506522","full_name":"arb/big-time","owner":"arb","description":"Big time makes it possible to have a timeout that is longer than 24.8 days (2^31-1 milliseconds).","archived":false,"fork":false,"pushed_at":"2020-01-21T15:14:59.000Z","size":94,"stargazers_count":2,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T20:46:06.646Z","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":"ankurp/homebridge-garage-opener","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-29T13:39:39.000Z","updated_at":"2018-04-11T00:02:15.000Z","dependencies_parsed_at":"2022-07-12T20:40:31.528Z","dependency_job_id":null,"html_url":"https://github.com/arb/big-time","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arb%2Fbig-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arb%2Fbig-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arb%2Fbig-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arb%2Fbig-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arb","download_url":"https://codeload.github.com/arb/big-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244725553,"owners_count":20499628,"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-11T04:26:29.102Z","updated_at":"2025-03-21T02:31:26.129Z","avatar_url":"https://github.com/arb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Big-Time\n\n[![Current Version](https://img.shields.io/npm/v/big-time.svg)](https://www.npmjs.org/package/big-time)\n[![Build Status via Travis CI](https://travis-ci.org/arb/big-time.svg?branch=master)](https://travis-ci.org/arb/big-time)\n[![belly-button-style](https://img.shields.io/badge/eslint-bellybutton-4B32C3.svg)](https://github.com/continuationlabs/belly-button)\n\n\nReworking of [long-timeout](https://github.com/tellnes/long-timeout) that has more features, follows correct semver, and has unit tests. Big-Time is a custom timer class to allow really long values into `setTimeout` that are larger than JavaScript would normally support (2^31-1).\n\n## Usage\n\n```js\n'use strict';\nconst bt = require('big-time');\n\nbt.setTimeout(() =\u003e {\n  console.log('if you wait for this, it will eventually log');\n}, Number.MAX_VALUE);\n\nconst timer = bt.setTimeout(() =\u003e {\n  console.log('shorter');\n}, 1000);\nbt.clearTimeout(timer);\n```\n\n## API\n\n### `bt.setTimeout(callback, delay, [arg1, arg2, arg3,...])`\n\nCreates a new Big-Time timer object and starts the timer where:\n\n- `callback` - the function to execute after `delay` milliseconds has passed. `callback` will be called with `arg1, arg2, arg3...` if they are passed into `setTimeout`, exactly like native `setTimeout`\n- `delay` - an integer representing the number of milliseconds to wait before executing `callback`. Alternatively, a `Date` instance can be provided. In this scenario, the delay is computed by subtracting `Date.now()` from the `Date` instance.\n- `[arg1, arg2, arg3,...]` - optional `N` number of extra parameters that will be passed back into `callback`.\n\n### `bt.clearTimeout(timer)`\n\nClears a running Big-Time object.\n\n### `Timeout.prototype.ref()`\n\nWhen called, requests that the Node.js event loop not exit so long as the\n`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.\n\nBy default, all `Timeout` objects are \"ref'd\", making it normally unnecessary to\ncall `timeout.ref()` unless `timeout.unref()` had been called previously.\n\nReturns a reference to the `Timeout`.\n\n### `Timeout.prototype.unref()`\n\nWhen called, the active `Timeout` object will not require the Node.js event loop\nto remain active. If there is no other activity keeping the event loop running,\nthe process may exit before the `Timeout` object's callback is invoked. Calling\n`timeout.unref()` multiple times will have no effect.\n\nReturns a reference to the `Timeout`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farb%2Fbig-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farb%2Fbig-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farb%2Fbig-time/lists"}