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

Function writeFile

test/fixtures/snapshot/typescript.js:7371–7387  ·  view source on GitHub ↗
(fileName, data, writeByteOrderMark)

Source from the content-addressed store, hash-verified

7369 return file;
7370 }
7371 function writeFile(fileName, data, writeByteOrderMark) {
7372 ts.perfLogger.logEvent("WriteFile: " + fileName);
7373 // If a BOM is required, emit one
7374 if (writeByteOrderMark) {
7375 data = byteOrderMarkIndicator + data;
7376 }
7377 var fd;
7378 try {
7379 fd = _fs.openSync(fileName, "w");
7380 _fs.writeSync(fd, data, /*position*/ undefined, "utf8");
7381 }
7382 finally {
7383 if (fd !== undefined) {
7384 _fs.closeSync(fd);
7385 }
7386 }
7387 }
7388 function getAccessibleFileSystemEntries(path) {
7389 ts.perfLogger.logEvent("ReadDir: " + (path || "."));
7390 try {

Callers 3

printFileFunction · 0.70

Calls 15

createCompilerDiagnosticFunction · 0.85
setWriterFunction · 0.85
emitShebangIfNeededFunction · 0.85
toPathFunction · 0.85
getBaseNameOfFileNameFunction · 0.85
writeFileWorkerFunction · 0.85
directoryExistsFunction · 0.85
measureMethod · 0.80
printFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…