
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.
stream-write
Advanced tools
Write to streams, respecting backpressure.
Write random numbers to an http response until it ends:
import write from 'stream-write'
import http from 'node:http'
http.createServer((req, res) => {
(async () => {
while (true) {
const isOpen = await write(res, String(Math.random()))
if (!isOpen) break
}
})().catch(console.error)
}).listen(8000)
Write chunk to stream and returns a Promise that is resolved once stream is writable again, or rejects if an error happened.
The promise's resolved value is false when stream ended and you should stop writing to it.
When an HTTP request ended, the HTTP response stays writable, only it's
underlying socket closes. To stay consistent with other streams' behavior,
in that case write() will throw an error itself.
$ npm install stream-write
MIT
FAQs
Write to a stream promise style
We found that stream-write 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.