diff options
| author | Agando <roduccomm@gmail.com> | 2026-06-18 18:00:54 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-06-18 18:00:54 +0200 |
| commit | 0eca39021874a673933ebb82b973002b682e7a4b (patch) | |
| tree | dbfbb685e40d10e6255e68629b72194b23709854 /modules/ext | |
| parent | fba6df22dae297c89fa0df065628dddded66c69c (diff) | |
auto: 2026-06-18_18:00 changes
Diffstat (limited to 'modules/ext')
| -rw-r--r-- | modules/ext/console.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/ext/console.js b/modules/ext/console.js index f041ad0..5d3007a 100644 --- a/modules/ext/console.js +++ b/modules/ext/console.js @@ -8,13 +8,23 @@ class JSConsoleModule { getHelpInfo() { return { 'js': 'js <expression> — Evaluate JavaScript in page context', - 'js-run': 'js-run <path> — Load and execute a JS file from VFS' + 'js-run': 'js-run <path> — Load and execute a JS file from VFS', + 'node': 'node <path> — Alias for js-run (executes a JS file from VFS)' }; } registerCommands() { this.commands['js'] = (args) => this.evalJS(args); this.commands['js-run'] = (args) => this.evalJSFile(args); + this.commands['node'] = (args) => { + // Bridge: AI hallucinates `node script.js` — map to js-run + if (!args[0]) return this.terminal.print('Usage: node <script.js> (alias for js-run)', 'warning'); + // Handle `node -e "expr"` — inline eval like Node.js + if (args[0] === '-e') { + return this.evalJS(args.slice(1)); + } + return this.evalJSFile(args); + }; } evalJS(args) { |