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

Function writeToFile

lib/internal/process/warning.js:67–82  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

65}
66
67function writeToFile(message) {
68 if (fd === undefined) {
69 fs = require('fs');
70 try {
71 fd = fs.openSync(warningFile, 'a');
72 } catch {
73 return writeOut(message);
74 }
75 process.on('exit', closeFdOnExit);
76 }
77 fs.appendFile(fd, `${message}\n`, (err) => {
78 if (err) {
79 writeOut(message);
80 }
81 });
82}
83
84function doEmitWarning(warning) {
85 process.emit('warning', warning);

Callers 1

onWarningFunction · 0.85

Calls 5

writeOutFunction · 0.85
requireFunction · 0.50
openSyncMethod · 0.45
onMethod · 0.45
appendFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…