Hey, currently working on a cli written in rescript, and I would like to print a module and/or record as it is (with variant, etc…) similar to bs-g
flag and debugging tool for chrome, but in the console directly.
Is there a way to do that ? thank’s
I suppose you can use interop for console.dir
module User = {
type t = {name: string}
let getName = (t) => t.name
}
@val @scope("console") external consoleDir: 'a => unit = "dir"
consoleDir(%raw("User"))
I mean, printing it as it is in the rescript side, with variant, and everything. Like having a string representation of the rescript module. Following your example, something like a string module User = { type t = {name: string}\nlet getName = (t) => t.name }