MCPcopy Index your code
hub / github.com/TypeStrong/ts-node / setupContext

Function setupContext

src/repl.ts:769–781  ·  view source on GitHub ↗
(
  context: any,
  module: Module,
  filenameAndDirname: 'eval' | 'stdin' | null
)

Source from the content-addressed store, hash-verified

767 * Set properties on `context` before eval-ing [stdin] or [eval] input.
768 */
769export function setupContext(
770 context: any,
771 module: Module,
772 filenameAndDirname: 'eval' | 'stdin' | null
773) {
774 if (filenameAndDirname) {
775 context.__dirname = '.';
776 context.__filename = `[${filenameAndDirname}]`;
777 }
778 context.module = module;
779 context.exports = module.exports;
780 context.require = module.require.bind(module);
781}

Callers 1

evalAndExitOnTsErrorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…