0.0.1-alpha.0 • Published 2 years ago

@chat-bots/node-stream v0.0.1-alpha.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

@chat-bots/node-stream

使用

安装依赖

$ npm i @chat-bots/node-stream -S

使用

执行本地代码

import { readResponseStream } from '@chat-bots/node-stream'

const response = await fetch('https://example.com', {
  headers: {
    Accept: 'text/event-stream',
  },
})

for await (const chunk of readResponseStream(response.body)) {
  console.log(chunk)
}

License

MIT

0.0.1-alpha.0

2 years ago