| description | Modern alternatives to the through package |
|---|
import through from 'through' // [!code --]
import { Writable } from 'node:stream' // [!code ++]
through(fn) // [!code --]
new Writable({ // [!code ++]
write: (chunk, encoding, callback) => { // [!code ++]
fn(chunk) // [!code ++]
callback() // [!code ++]
} // [!code ++]
}) // [!code ++]