Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
buffered-async-iterable
Advanced tools
Buffered processing of async iterables / generators in parallel to achieve comparable performance to Promise.all()
WORK IN PROGRESS – early prerelease
import { bufferedAsyncMap } from 'buffered-async-iterable';
async function * asyncGenerator() {
yield ...
}
const mappedIterator = bufferedAsyncMap(asyncGenerator(), async (item) => {
// Apply additional async lookup / processing
});
for await (const item of mappedIterator) {
// Consume the buffered async iterable
}
import { bufferedAsyncMap } from 'buffered-async-iterable';
const mappedIterator = bufferedAsyncMap(['foo'], async (item) => {
// Apply additional async lookup / processing
});
for await (const item of mappedIterator) {
// Consume the buffered async iterable
}
import { bufferedAsyncMap } from 'buffered-async-iterable';
const mappedIterator = bufferedAsyncMap(['foo'], async function * (item) => {
// Apply additional async lookup / processing
yield ...
yield * ...
});
for await (const item of mappedIterator) {
// Consume the buffered async iterable
}
bufferedAsyncMap(input, callback[, { bufferSize=6 }]) => AsyncIterableIterator
Iterates and applies the callback
to up to bufferSize
items from input
yielding values as they resolve.
input
– either an async iterable, an ordinare iterable or an arraycallback(item)
– should be either an async generator or an ordinary async function. Items from async generators are buffered in the main buffer and the buffer is refilled by the one that has least items in the current buffer (input
is considered equal to sub iterators in this regard when refilling the buffer)bufferSize
– optional – defaults to 6
, sets the max amount of simultanoeus items that processed at once in the buffer.FAQs
Creates a prefetched async iterable
The npm package buffered-async-iterable receives a total of 3,303 weekly downloads. As such, buffered-async-iterable popularity was classified as popular.
We found that buffered-async-iterable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.