Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ecma-async-loop
Advanced tools
Readme
JavaScript / TypeScript library to help to perform asynchronous loop
javescripeto de assinchrono
You have a async function and need to loop it, but the loop structure in ecmascript do not allow you to use "await" keywork inside a loop (you are allowed, but it does not work)
async function yourCustomAsyncFunction(): Promise<void> {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 100);
});
}
it does not work:
let index = 0;
while (index < 10) {
await yourCustomAsyncFunction();
}
But you can do that:
asyncDoWhile({
while: () => index < 10,
execute: () => yourCustomAsyncFunction()
}).then(() => {
// loop complete
}).catch(e => {
// some of the functions has broken
});
// you can create an execution queue to use in the for each method:
declare someHttpApi(importantData: number): Promise<void>;
const dataToSendToSomeApi = [ 2, 4, 2, 2, 6 ];
// here you create an array of async functions (or functions that returns promises)
const executionQueue = dataToSendToSomeApi.map(no => {
return () => someHttpApi(importantData);
});
asyncForEach(executionQueue).then(() => {
// loop complete
}).catch(e => {
// some of the functions has broken
});
npm install ecma-async-loop --save
No one feature will be implemented without it having an open issue and without which the proposed has been accepted by the team responsible for the project. After the issue is approved, the applicant, a team member or anyone else can open a pull request associated with that issue (just paste the issue link in the pull request).
When logging a bug, please be sure to include the following:
You can try to update the library to the last version to see if the bug has already been fixed.
Search the existing issues before logging a new one.
Some search tips:
Follow the steps:
git clone
of your forked repository and run npm install
in the application folder;npm run lint
, npm run test
and npm run build
in the repository;FAQs
JavaScript / TypeScript library to help to perform asynchronous loop
The npm package ecma-async-loop receives a total of 3 weekly downloads. As such, ecma-async-loop popularity was classified as not popular.
We found that ecma-async-loop 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.