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

Function installConsoleExtensions

lib/internal/util/inspector.js:70–81  ·  view source on GitHub ↗
(commandLineApi)

Source from the content-addressed store, hash-verified

68
69// Create a special require function for the inspector command line API
70function installConsoleExtensions(commandLineApi) {
71 if (commandLineApi.require) { return; }
72 const { tryGetCwd } = require('internal/process/execution');
73 const CJSModule = require('internal/modules/cjs/loader').Module;
74 const { makeRequireFunction } = require('internal/modules/helpers');
75 const consoleAPIModule = new CJSModule('<inspector console>');
76 const cwd = tryGetCwd();
77 consoleAPIModule.paths = [];
78 ArrayPrototypePushApply(consoleAPIModule.paths, CJSModule._nodeModulePaths(cwd));
79 ArrayPrototypePushApply(consoleAPIModule.paths, CJSModule.globalPaths);
80 commandLineApi.require = makeRequireFunction(consoleAPIModule);
81}
82
83// Wrap a console implemented by Node.js with features from the VM inspector
84function wrapConsole(consoleFromNode) {

Callers

nothing calls this directly

Calls 3

tryGetCwdFunction · 0.85
makeRequireFunctionFunction · 0.85
requireFunction · 0.50

Tested by

no test coverage detected