First, thank you for the wonderful project! It's been really helpful.
I recently started using the repl module for a project I was hoping to implement in Go rather than Node.js, and I quickly ran into a stakeholder concern of lacking the helpful REPL feature of pretty-printing the results of expressions.
For example, using repl.Run, referencing a JS object results in this being printed
[object Object]
instead of something helpful like the Node.js repl prints:
First, thank you for the wonderful project! It's been really helpful.
I recently started using the repl module for a project I was hoping to implement in Go rather than Node.js, and I quickly ran into a stakeholder concern of lacking the helpful REPL feature of pretty-printing the results of expressions.
For example, using
repl.Run
, referencing a JS object results in this being printedinstead of something helpful like the Node.js repl prints:
Looking into the code, I don't see any way to customize the printed output, so I was wondering if you would be open to a pull request?
Here is the relevant code:
One way to permit this use case is to add an optional Eval func to the
repl.Options
struct that replaces the line above, if set.How does that sound?
Thank you, Rob