Skip to content

Instantly share code, notes, and snippets.

Created December 22, 2019 15:42
What would you like to do?
export const mapStream = <A, B>(f: (a: A) => B, source: Readable) =>
new Transform({
objectMode: true,
transform: (chunk, _, callback) => {
callback(null, f(chunk));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment