
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
@iterables/take
Advanced tools
Given an iterable, return an iterable for the leading subset of elements.
const take = require('@iterables/take')
console.log([...take([1,2,3], 1)]) // [1]
console.log([...take.until([1,2,3], xs => xs % 2 === 0)]) // [1]
console.log([...take.while([1,2,3], xs => xs !== 3)]) // [1, 2]
$ npm install --save @iterables/take
take(iterable, n = Infinity) -> Iterator<T>Lazily take the first n elements of iterable, where n is an integer
defaulting to Infinity. The returned iterator is exhausted when n is
reached or when iterable is exhausted.
take.while(iterable, test) -> Iterator<T>Lazily take the first n elements of iterable while test returns true.
test should be a function taking xs, idx, and all and returning
Boolean. xs will be an element of the iterable, idx will be the index,
and all will be the original iterable argument. The returned iterator is
exhausted when test returns false, or when iterable is exhausted.
take.until(iterable, test) -> Iterator<T>Lazily take the first n elements of iterable while test returns false.
test should be a function taking xs, idx, and all and returning
Boolean. xs will be an element of the iterable, idx will be the index,
and all will be the original iterable argument. The returned iterator is
exhausted when test returns true, or when iterable is exhausted.
MIT
FAQs
Take a number of elements from an iterable.
The npm package @iterables/take receives a total of 1 weekly downloads. As such, @iterables/take popularity was classified as not popular.
We found that @iterables/take 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.