diff --git a/libraries/deno-commons-mod.ts b/libraries/deno-commons-mod.ts index ecec189..c121997 100644 --- a/libraries/deno-commons-mod.ts +++ b/libraries/deno-commons-mod.ts @@ -28,14 +28,30 @@ export class ProcessOutput { return this; } + stdoutThenTrim(): string { + return this.getStdoutAsStringThenTrim(); + } getStdoutAsStringThenTrim(): string { return this.stdout.trim(); } + stderrThenTrim(): string { + return this.getStderrAsStringThenTrim(); + } + getStderrAsStringThenTrim(): string { + return this.stderr.trim(); + } + + stdoutAsJson(): any { + return this.getStdoutAsJson(); + } getStdoutAsJson(): any { return JSON.parse(this.stdout); } + stderrAsJson(): any { + return this.getStderrAsJson(); + } getStderrAsJson(): any { return JSON.parse(this.stderr); } @@ -44,7 +60,8 @@ export class ProcessOutput { export async function execCommandAndStdout( command: string, args?: string[], - options?: Deno.CommandOptions,): Promise { + options?: Deno.CommandOptions, +): Promise { const processOutput = await execCommand(command, args, options); processOutput.assertSuccess(); return processOutput.stdout.trim();