Installations
npm install yoctodelay
Developer
sindresorhus
Developer Guide
Module System
ESM
Min. Node Version
^12.20.0 || ^14.13.1 || >=16.0.0
Typescript Support
No
Node Version
12.22.1
NPM Version
7.10.0
Statistics
117 Stars
12 Commits
14 Forks
4 Watching
1 Branches
5 Contributors
Updated on 13 Oct 2024
Languages
JavaScript (75.06%)
TypeScript (24.94%)
Total Downloads
Cumulative downloads
Total Downloads
3,240,155
Last day
-14.3%
2,276
Compared to previous day
Last week
7.1%
16,743
Compared to previous week
Last month
20.5%
64,718
Compared to previous month
Last year
-26.6%
721,603
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
yoctodelay
Delay a promise a specified amount of time
It's less than half the size of the nanodelay
module.
Note: If you target Node.js 16 or later, you can use the built-in functionality instead:
1import {setTimeout as delay} from 'node:timers/promises'; 2 3await delay(100);
Install
$ npm install yoctodelay
Usage
1import delay from 'yoctodelay'; 2 3foo(); 4 5await delay(100); 6 7// Executed 100 milliseconds later 8bar();
API
delay(milliseconds)
Delay the promise and then resolve.
milliseconds
Type: number
The duration to delay the promise.
FAQ
What is yocto?
It's the smallest official unit prefix in the metric system. Much smaller than nano.
Is this a joke?
Partly. The nanodelay
module was created only because the delay
module is a tiny bit larger. Well, this module is a tiny bit smaller than the nanodelay
module. Comparing size at the byte level is super silly. It doesn't matter unless the difference is more than many kilobytes. This is still a fully working module though. Go ahead and use it.
Related
- delay - Similar to this module but with more features
- yoctocolors - The smallest and fastest command-line coloring package on the internet
- More…
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
Found 4/12 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/yoctodelay/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/yoctodelay/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:20
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
3.7
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More