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

Method defineCommand

lib/repl.js:1250–1257  ·  view source on GitHub ↗
(keyword, cmd)

Source from the content-addressed store, hash-verified

1248 };
1249 }
1250 defineCommand(keyword, cmd) {
1251 if (typeof cmd === 'function') {
1252 cmd = { action: cmd };
1253 } else {
1254 validateFunction(cmd.action, 'cmd.action');
1255 }
1256 this.commands[keyword] = cmd;
1257 }
1258}
1259
1260// Prompt is a string to print on each line for the prompt,

Callers 3

defineDefaultCommandsFunction · 0.80
createReplFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected