Skip to content

ratson/deno-subprocess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

❯ Content

❯ Install

This module can be imported directly from the repo and from following registries.

Deno Registry

import * as subprocess from "https://deno.land/x/subprocess/mod.ts";

Github

import * as subprocess from "https://raw.githubusercontent.com/ratson/deno-subprocess/master/mod.ts";

❯ Usage

output()

Capture stdout output from a command.

import * as subprocess from "https://deno.land/x/subprocess/mod.ts";

const stdout: string = await subprocess.output(["deno", "--version"]);

stderrOutput()

Capture stderr output from a command.

import * as subprocess from "https://deno.land/x/subprocess/mod.ts";

const stderr: string = await subprocess.stderrOutput(["deno", "--version"]);

run()

Run a command.

import * as subprocess from "https://deno.land/x/subprocess/mod.ts";

const { code, success } = await subprocess.run(["deno", "--version"]);

Run a command without printing to stdout and stderr.

import * as subprocess from "https://deno.land/x/subprocess/mod.ts";

const result = await subprocess.run(["deno", "--version"], { stderr: "null", stdout: "null" });

Run a command with captured output.

import * as subprocess from "https://deno.land/x/subprocess/mod.ts";

const result = await subprocess.run(["deno", "--version"], { stderr: "piped", stdout: "piped" });
const { code, success, stderr, stdout } = result

About

Capture command output wihtout boilerplate

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published