
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Create a cancellable promise that will be resolved in a specified amount of time.
Create a cancellable promise that will be resolved in a specified amount of time.
const Delayer = require('delayer')
// example usage
let d = new Delayer(1000)
d.then(onFulfilled, onRejected)
On supported environments, Delayer
extends from Promise
but returns Promise
objects from Promise.prototype
methods.
The weird stuff that led to this disconnect include:
Promise[Symbol.species]
- node.js 6.5; Chrome 51let d = new Delayer(delay)
Creates a new instance of Delayer
which creates an associated promise, which either resolves after the specified amount of time or rejects when cancel
is called.
On supported environments, the associated promise is equivalent to the Delayer
instance. On older environments, the associated promise is hidden; Promise
prototype methods are proxied to the promise, making the instance a valid thenable.
Parameters:
delay
: The amount of time to delay, in milliseconds.d.delay
The delay passed to the constructor.
d.cancel()
Cancels the delayed promise. This will put the promise in a rejected state.
delayer [delay]
FAQs
Create a cancellable promise that will be resolved in a specified amount of time.
The npm package delayer receives a total of 1 weekly downloads. As such, delayer popularity was classified as not popular.
We found that delayer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.