
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
consume-until
Advanced tools
Consume a stream until a given pattern is found.
npm install consume-until --save
var net = require('net')
var consumeUntil = require('consume-until')
var socket = net.connect({ host: 'example.com', port: 80 })
socket.write('GET / HTTP/1.1\r\n')
socket.write('Host: example.com\r\n')
socket.write('\r\n')
consumeUntil(socket, '\r\n\r\n', function (err, headers) {
if (err) throw err
console.log('HTTP response headers:')
console.log(headers)
console.log('HTTP response body:')
socket.pipe(process.stdout)
})
consumeUntil(stream, pattern, callback)The module exposes a single function which takes 3 arguments:
stream - The stream to consumepattern - Either a string or a buffer containing the pattern to look
for in the streamcallback - The callback will be called when the pattern is
detected. The data consumed up until the pattern will be given as the
second argument. An error is given as the first argument if the
stream either ends before the pattern is found or emits an errorMIT
FAQs
Consume a stream until a given pattern is found
The npm package consume-until receives a total of 60 weekly downloads. As such, consume-until popularity was classified as not popular.
We found that consume-until 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
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.