Skip to content

Instantly share code, notes, and snippets.

@vimtaai
Created February 13, 2025 23:10
Show Gist options
  • Save vimtaai/8810180983615f9ae93de14e24bf62af to your computer and use it in GitHub Desktop.
Save vimtaai/8810180983615f9ae93de14e24bf62af to your computer and use it in GitHub Desktop.
A modern way to read stdin in Node.js
import { stdin } from "node:process";
const buffer = await Array.fromAsync(stdin);
const data = buffer.toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment