
Product
Introducing Supply Chain Attack Campaigns Tracking in the Socket Dashboard
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.
使用 fetch 实现 EventSource, 支持 fetch 的所有功能
$ npm install sse-fetch
import EventSource from 'sse-fetch';
const eventSource = new EventSource('http://localhost:3000/sse', {
method: 'POST',
});
eventSource.addEventListener('message', (event) => {
console.log(event.data);
});
除了支持 EventSource 的及 fetch 的所有配置,还支持以下配置:
| 属性名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| json | boolean | false | 如果 data 为 json 是否自动解析返回的 json |
| serverEnd | boolean | false | 如果服务端主动关闭连接,客户端不再尝试重连 |
FAQs
use fetch
We found that sse-fetch 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
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.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.