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

Function hook

test/module-hooks/test-module-hooks-load-esm.js:20–23  ·  view source on GitHub ↗
(code, filename)

Source from the content-addressed store, hash-verified

18
19const hookArgs = [];
20function hook(code, filename) {
21 hookArgs.push({ code, filename });
22 return code.replace('$key', 'hello');
23}
24
25(async () => {
26 const revert = addHook(hook, { exts: ['.js'], matcher });

Callers 2

testHookFunction · 0.50
loadFunction · 0.50

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…