Skip to content

stream: unref

Rodrigo Muino Tomonari requested to merge github/fork/rluvaton/unref-stream into main

Current WIP unref implementation that was talked about in:

Cc @benjamingr, @ronag WDYT?


This would allow the following code:

const csvParsedStream = fs
	.createReadStream('file.csv')
	.compose(csvParse({ columns: false }));

const [columns] = await unref(csvParsedStream)
	.take(1)
	.toArray();

const parsed = await csvParsedStream.map((row) => parseRowByColumns(row, columns)).toArray();

Merge request reports

Loading