deno / latest / ~ / deno.stdin.html

Deno.stdin

A reference to stdin which can be used to read directly from stdin. It implements the Deno specific Reader, ReaderSync, and Closer interfaces as well as provides a ReadableStream interface.

Reading chunks from the readable stream

const decoder = new TextDecoder();
for await (const chunk of Deno.stdin.readable) {
  const text = decoder.decode(chunk);
  // do something with the text
}
const stdin: 
     
& Reader
& Closer
& {
readonly rid: number;
readonly readable: ReadableStream<Uint8Array>;
setRaw(mode: boolean, options?: SetRawOptions): void;
}
;

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.stdin