Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSreadable vs writable streamsSingle-choice MCQ

What does cork() followed by uncork() on a Writable stream achieve when the stream implements both _write and _writev?

const w = new Writable({ write(c, e, cb) { cb(); }, writev(chunks, cb) { console.log('writev', chunks.length); cb(); } }); w.cork(); w.write('a'); w.write('b'); w.write('c'); process.nextTick(() => w.uncork());