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

Function appendFile

lib/internal/fs/promises.js:2118–2131  ·  view source on GitHub ↗
(path, data, options)

Source from the content-addressed store, hash-verified

2116}
2117
2118async function appendFile(path, data, options) {
2119 options = getOptions(options, { encoding: 'utf8', mode: 0o666, flag: 'a' });
2120 parseFileMode(options.mode, 'mode', 0o666);
2121
2122 const h = vfsState.handlers;
2123 if (h !== null) {
2124 checkAborted(options.signal);
2125 const promise = h.appendFile(path, data, options);
2126 if (promise !== undefined) { await promise; return; }
2127 }
2128 options = copyObject(options);
2129 options.flag ||= 'a';
2130 return writeFile(path, data, options);
2131}
2132
2133async function readFile(path, options) {
2134 const h = vfsState.handlers;

Callers

nothing calls this directly

Calls 6

parseFileModeFunction · 0.85
copyObjectFunction · 0.85
getOptionsFunction · 0.70
checkAbortedFunction · 0.70
writeFileFunction · 0.70
appendFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…