
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
async-inprogress
Advanced tools
This is a small utility for generating while loops with ES6 Promises.
Download a UMD bundle from the releases page. The variable asyncWhile will be attached to window.
<script type="text/javascript" src="async-while.js"></script>
If using Browserify or Node.js, you can install via NPM.
$ npm install async-while
First, load async while. By default, the global Promise object is used, but you can create a while generator with a custom Promise class, too.
// simple
var asyncWhile = require("async-while");
// while with Bluebird promises
var Promise = require("bluebird");
var asyncWhile = require("async-while").generate(Promise);
Now, generate a while function with asyncWhile. You'll need two functions: a synchronous condition and an action.
var myWhile = asyncWhile(
function (data) {
// synchronous conditional
return true;
},
function (data) {
// loop content goes here
return doSomethingAsync(data);
}
);
This is just a method that can be called directly or used in .then() statements.
myWhile(somedata).then(function (result) {
console.log(result);
});
// or
someAsyncAction()
.then(myWhile)
.then(function (result) {
console.log(result);
});
Here is a common use case of the while loop, processing list items in a series:
function eachSeries(items, onEach, ctx) {
var index = -1;
return asyncWhile(
function () {
// bump index before every loop
index++;
// synchronously checks if there are more
return index < items.length;
},
function () {
return onEach.call(ctx, items[index], index, items);
}
)();
}
FAQs
async-while fork
We found that async-inprogress 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.