Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/dts/lib.deno.ns.d.ts>Deno.stdin

A modern runtime for JavaScript and TypeScript.
Go to Latest
variable Deno.stdin
import { Deno } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.ns.d.ts";
const { stdin } = Deno;

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
}

type

& { readonly rid: number; readonly readable: ReadableStream<Uint8Array>; setRaw(mode: boolean, options?: SetRawOptions): void; }