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

Method appendFileSync

lib/internal/vfs/provider.js:339–350  ·  view source on GitHub ↗

* Appends to a file synchronously. * @param {string} path The file path * @param {Buffer|string} data The data to append * @param {object} [options] Options

(path, data, options)

Source from the content-addressed store, hash-verified

337 * @param {object} [options] Options
338 */
339 appendFileSync(path, data, options) {
340 if (this.readonly) {
341 throw createEROFS('open', path);
342 }
343 const flag = options?.flag ?? 'a';
344 const handle = this.openSync(path, flag, options?.mode);
345 try {
346 handle.writeFileSync(data, options);
347 } finally {
348 handle.closeSync();
349 }
350 }
351
352 /**
353 * Checks if a path exists.

Calls 4

openSyncMethod · 0.95
createEROFSFunction · 0.85
writeFileSyncMethod · 0.45
closeSyncMethod · 0.45

Tested by

no test coverage detected