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

Function tryGetCwd

lib/internal/process/execution.js:50–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48const kEvalTag = '[eval]';
49
50function tryGetCwd() {
51 try {
52 return process.cwd();
53 } catch {
54 // getcwd(3) can fail if the current working directory has been deleted.
55 // Fall back to the directory name of the (absolute) executable path.
56 // It's not really correct but what are the alternatives?
57 return path.dirname(process.execPath);
58 }
59}
60
61let evalIndex = 0;
62function getEvalModuleUrl() {

Callers 2

createModuleFunction · 0.85
installConsoleExtensionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…