
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
fetch-streaming
Advanced tools
Simple XMLHTTPRequest-based `fetch` implementation for streaming content.
Simple XMLHTTPRequest-based fetch implementation for streaming content.
60 LOC and no dependencies, works in all browsers.
This is not a replacement for fetch - there is no API match.
npm install --save fetch-streaming
const fetchS = require('fetch-streaming');
// Would be executed for every new chunk of data.
fetchS('/api/stream', stream => console.log(stream));
// Options
const options = {method: 'POST', headers: {'Content-Type': 'BS'}};
fetchS('/api/stream', options, stream => console.log(stream));
// Promise is returned.
const result = fetchS('/api/stream');
result.then(response => {console.log(response.body)}, error => {console.error(error)})
Example of server-side express.js infinite endpoint.
app.get('/api/stream', (req, res) => {
res.write(Date.now().toString());
// Send new data every second.
setInterval(() => {
res.write(Date.now().toString());
}, 1000);
});
MIT
FAQs
Simple XMLHTTPRequest-based `fetch` implementation for streaming content.
We found that fetch-streaming 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.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.