MCPcopy Index your code
hub / github.com/nodejs/node / doWriteStream

Function doWriteStream

test/parallel/test-fs-promises-file-handle-writeFile.js:85–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83};
84
85async function doWriteStream() {
86 const fileHandle = await open(dest, 'w+');
87 try {
88 await fileHandle.writeFile(stream);
89 const expected = 'abc';
90 const data = fs.readFileSync(dest, 'utf-8');
91 assert.deepStrictEqual(data, expected);
92 } finally {
93 await fileHandle.close();
94 }
95}
96
97async function doWriteStreamWithCancel() {
98 const controller = new AbortController();

Calls 4

openFunction · 0.70
closeMethod · 0.65
writeFileMethod · 0.45
readFileSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…