Does Deno have a utility function that dumps a Object or primitive to a string like Node.js util.inspect
?
For example in Node.js I create an json object and want to dump out its contents in Node:
> m = {k1:'v1', k2:'v2'}
{ k1: 'v1', k2: 'v2' }
> util.inspect(m)
'{ k1: \'v1\', k2: \'v2\' }'
Deno's equivalent of Node's util.inspect
is Deno.inspect
.
For example in the deno REPL:
> m = {k1:'v1', k2:'v2'}
{ k1: "v1", k2: "v2" }
> Deno.inspect(m)
{ k1: "v1", k2: "v2" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With