This method is similar to Array.prototype.find and calls fn on each chunk in the stream to find a chunk with a truthy value for fn. Once an fn call's awaited return value is truthy, the stream is destroyed and the promise is fulfilled with value for which fn returned a truthy value. If all of the fn calls on the chunks return a falsy value, the promise is fulfilled with undefined.
Search the reference...
/
method
a function to call on each chunk of the stream. Async or not.
a promise evaluating to the first chunk for which fn evaluated with a truthy value, or undefined if no element was found.
This method is similar to Array.prototype.find and calls fn on each chunk in the stream to find a chunk with a truthy value for fn. Once an fn call's awaited return value is truthy, the stream is destroyed and the promise is fulfilled with value for which fn returned a truthy value. If all of the fn calls on the chunks return a falsy value, the promise is fulfilled with undefined.
a function to call on each chunk of the stream. Async or not.
a promise evaluating to the first chunk for which fn evaluated with a truthy value, or undefined if no element was found.
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →Socket.find method | Node.js net module | Bun,AI智能索引,全网链接索引,智能导航,网页索引
- API documentation for method node:net.Socket.find | Bun