How to use the finished function from readable-stream

Find comprehensive JavaScript readable-stream.finished code examples handpicked from public code repositorys.

105
106
107
108
109
110
111
112
113
114

  self[kFlushed]()
})

const proxy = Duplex.from({ writable: decode, readable: encode })
finished(proxy, cleanup)
this[kRpcStream] = proxy
return proxy

function cleanup () {
fork icon2
star icon15
watch icon8

103
104
105
106
107
108
109
110
111

  readableClosed = true;
  maybeClose();
});

finished(this[_output], err => {
  if (err) {
    this.emit('error', err);
  }
fork icon2
star icon8
watch icon2

37
38
39
40
41
42
43
44
45
46
const carml = carmlCli({ mappingFile, onError: err => stream.destroy(err) })
const parser = new N3Parser({ factory: rdf })
const quadStream = parser.import(carml.stdout)
const stream = duplexify.obj(carml.stdin, quadStream)

finished(quadStream, () => {
  onFinished.forEach(callback => callback())
})

return stream
fork icon0
star icon0
watch icon7