json

Bun

Symbol

$.ShellError.json

json(): any

Read from stdout as a JSON object

@returns

Stdout as a JSON object

const output = await $`echo '{"hello": 123}'`;
console.log(output.json()); // { hello: 123 }