hackium icon indicating copy to clipboard operation
hackium copied to clipboard

Hackium cli needs a quiet mode and a way to disable the REPL

Open jsoverson opened this issue 4 years ago • 1 comments

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"}

jsoverson avatar Sep 27 '20 16:09 jsoverson

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.

jsoverson avatar Sep 27 '20 16:09 jsoverson