From 9d025facaa9b97a27d751dbcd67d8c003c77f3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Feb 2019 21:52:35 +0100 Subject: manual: add Deno.run example (#1811) --- js/process.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'js/process.ts') diff --git a/js/process.ts b/js/process.ts index c47a5b5dd..2f60e5c4a 100644 --- a/js/process.ts +++ b/js/process.ts @@ -8,7 +8,7 @@ import { ReadCloser, WriteCloser } from "./io"; import { readAll } from "./buffer"; import { assert, unreachable } from "./util"; -/** How to handle subsubprocess stdio. +/** How to handle subprocess stdio. * * "inherit" The default if unspecified. The child inherits from the * corresponding parent descriptor. @@ -101,6 +101,18 @@ function stdioMap(s: ProcessStdio): msg.ProcessStdio { } } +/** + * Spawns new subprocess. + * + * Subprocess uses same working directory as parent process unless `opt.cwd` + * is specified. + * + * Environmental variables for subprocess can be specified using `opt.env` + * mapping. + * + * By default subprocess inherits stdio of parent process. To change that + * `opt.stdout`, `opt.stderr` and `opt.stdin` can be specified independently. + */ export function run(opt: RunOptions): Process { const builder = flatbuffers.createBuilder(); const argsOffset = msg.Run.createArgsVector( -- cgit v1.2.3