{"id":16641799,"url":"https://github.com/samthor/promises","last_synced_at":"2025-10-30T11:31:19.076Z","repository":{"id":32795210,"uuid":"142811880","full_name":"samthor/promises","owner":"samthor","description":"The missing Promise helpers your JavaScript project needs","archived":false,"fork":false,"pushed_at":"2022-02-11T00:48:39.000Z","size":45,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T08:11:21.508Z","etag":null,"topics":["javascript","promises"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samthor.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":"2018-07-30T01:55:04.000Z","updated_at":"2023-09-07T08:15:59.000Z","dependencies_parsed_at":"2022-08-07T18:01:44.326Z","dependency_job_id":null,"html_url":"https://github.com/samthor/promises","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/samthor%2Fpromises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fpromises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fpromises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fpromises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samthor","download_url":"https://codeload.github.com/samthor/promises/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238960266,"owners_count":19559230,"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":["javascript","promises"],"created_at":"2024-10-12T07:47:54.648Z","updated_at":"2025-10-30T11:31:13.798Z","avatar_url":"https://github.com/samthor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/samthor/promises.svg?branch=master)](https://travis-ci.org/samthor/promises)\n\nThe missing `Promise` helpers your project needs—just contains a few helpers that can benefit your project.\nShips as an ES module.\n\nRequires a native implementation of `Promise` (maybe a polyfill will work too), and support for `async` and `await`.\nYou might be able to transpile these requirements away for [older browsers](https://medium.com/dev-channel/es6-modules-in-chrome-canary-m60-ba588dfb8ab7).\n\n## Usage\n\nAdd to your dependencies via NPM or Yarn.\n\n```js\nimport * as promises from './node_modules/promiseslib/index.js';  // or\nimport * as promises from 'promiseslib';  // maybe, but must be transpiled\n```\n\nIf you're feeling lazy, open this file in [RawGit](https://rawgit.com/?url=https://github.com/samthor/promises/blob/master/index.js) and use the latest production link.\nThis won't provide you with updates but it is easy to include whole \"https://...\" paths via ES modules.\n\n### Methods\n\n* `promises.sleep(ms)`: builds a `Promise` which resolves after a specified time (or a frame if negative, or microtask if null/undefined is passed)\n\n* `promises.event(target, event)`: builds a `Promise` which resolves when the given event occurs\n\n* `promises.dedup(fn, ms)`: builds a dedup function which delays calls until the last in the specified period, all calls return the same shared `Promise` representing the completion of the last call\n\n* `promises.makeSingle(generator)`: converts a generator (that yields `Promise` instances) into a task that can only run at most once ([read more](https://dev.to/chromiumdev/cancellable-async-functions-in-javascript-5gp7))\n\n* `promises.group(callback)`: builds a wait group; aka a function which, when called with a `Promise`, returns a new `Promise` that waits for all passed promises to complete before resolving\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Fpromises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamthor%2Fpromises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Fpromises/lists"}