
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@pkgai/sse-parser
Advanced tools
<!-- automd:badges color="orange" license licenseBranch bundlephobia packagephobia name="@pkgai/sse-parser" -->
SSE EventStream 数据解析器
# ✨ Auto-detect
npx nypm install @pkgai/sse-parser
# npm
npm install @pkgai/sse-parser
# yarn
yarn add @pkgai/sse-parser
# pnpm
pnpm install @pkgai/sse-parser
# bun
bun install @pkgai/sse-parser
# deno
deno install @pkgai/sse-parser
import { readableStream } from '@pkgai/sse-parser'
const response =await fetch('https://openai-like/v1/chat/completions',{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer {API_KEY}',
},
body: JSON.stringify({
model: 'qwq-32b',
messages: [
{
role: 'user',
content: '9.9和9.11谁大',
},
],
stream: true,
stream_options: {
include_usage: true,
},
})
})
for await (const chunk of readableStream(response.body!)) {
console.log(chunk)
// data:
console.log(chunk.data)
// event:
console.log(chunk.event)
}
import { response } from '@pkgai/sse-parser'
const res =await fetch('https://openai-like/v1/chat/completions',{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer {API_KEY}',
},
body: JSON.stringify({
model: 'qwq-32b',
messages: [
{
role: 'user',
content: '9.9和9.11谁大',
},
],
stream: true,
stream_options: {
include_usage: true,
},
})
})
for await (const chunk of response(res)) {
console.log(chunk)
// data:
console.log(chunk.data)
// event:
console.log(chunk.event)
}
将 ReadableStream<Uint8Array> 转换为 ReadableStream<EventSourceMessage>
import { EventSourceStream } from '@pkgai/sse-parser'
const readableStream = getReadableStream()
readableStream.pipeThrough(new EventSourceStream())
Published under the MIT license.
Made by @Colourlessglow and community 💛
🤖 auto updated with automd
FAQs
<!-- automd:badges color="orange" license licenseBranch bundlephobia packagephobia name="@pkgai/sse-parser" -->
We found that @pkgai/sse-parser 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.