文件名称:sse-parse-stream:双工流以解析sse
文件大小:2KB
文件格式:ZIP
更新时间:2024-06-11 20:43:07
JavaScript
sse-parse-stream 双工流解析 。 例子 var parse = require ( 'sse-parse-stream' ) , through = require ( 'through2' ) , tr = through ( ) ; tr . pipe ( parse ( ) ) . pipe ( through . obj ( function ( row , enc , cb ) { console . log ( row ) ; cb ( ) ; } ) ) ; tr . write ( 'event: sup\ndata: { "x": "555" }\n\n' ) ; 产生: [ 'sup', { x: '555' } ] api var parse = require ( 'sse-parse-str
【文件预览】:
sse-parse-stream-master
----Readme.md(763B)
----test.js(367B)
----index.js(515B)
----package.json(714B)