
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.
Sleep function 😴. Convenient for unit testing and general purpose usage.
That's the Swedish translation of the Western and North European folklore character Sandman who puts people to sleep.
npm i blund --save
import sleep from 'blund';
class Service {
foo(promise) {
promise.then(() => this.bar());
}
bar(data) {
// do stuff
}
}
describe('async module', () => {
let service;
beforeEach(() => {
service = new Service();
});
it('should work', async () => {
const spy = spyOn(service, 'bar');
service.foo(new Promise(resolve => setTimeout(resolve, 3)));
await sleep(5);
expect(spy).toHaveBeenCalled();
});
});
MIT
FAQs
A sleep function. Main purpose is testing.
The npm package blund receives a total of 13 weekly downloads. As such, blund popularity was classified as not popular.
We found that blund 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.