hackium
hackium copied to clipboard
Hackium cli needs a quiet mode and a way to disable the REPL
Hackium scripts that output data via console.log() can not output cleanly because hackium outputs at least one Info
log, the return value of the hackium script, and the REPL prompt. The REPL also can't be easily closed programmatically and there should be an easier way to close the browser automatically.
sample script
test.js:
console.log(JSON.stringify({ test: "data" }));
Command
$ hackium -e test.js
Actual
Browser opens and stays open. REPL instantiates after script finishes and stays open.
Output:
{"test":"data"}
undefined
Info: Hackium launched
>
Expected
Browser closes automatically, REPL never opens (or closes, silently, on its own)
Output:
{"test":"data"}
The REPL is good for troubleshooting and first-time users and may not be best as a default. It may make more sense to have an '--interactive' flag/option that turns on the REPL when running via CLI. For backwards compatibility maybe -e
should turn interactive on by default and another flag should exist for dev-centric usage.