diff --git a/libraries/deno-commons-mod.ts b/libraries/deno-commons-mod.ts index 0d957d6..3ee8304 100644 --- a/libraries/deno-commons-mod.ts +++ b/libraries/deno-commons-mod.ts @@ -29,6 +29,18 @@ export class ProcessOutput { } return this; } + + getStdoutAsStringThenTrim(): string { + return this.stdout.trim(); + } + + getStdoutAsJson(): any { + return JSON.parse(this.stdout); + } + + getStderrAsJson(): any { + return JSON.parse(this.stderr); + } } export async function execCommand(