server
Express gzip streamres.write(serialize(data)) res.end()
res.setHeader('content-type', 'application/x-msgpack') for (const facility of facilities) { res.write(new Uint8Array(Buffer.from(JSON.stringify(facility)))) } return res.end()
아래와 같다
const inStream = new Readable({ read() { const iterated = facilityMaker.next() if (!iterated.done) this.push(new Uint8Array(Buffer.from(JSON.stringify(iterated.value)))) else this.push(null) } }) inStream.pipe(res)

Seonglae Cho