Created
February 13, 2025 23:10
-
-
Save vimtaai/8810180983615f9ae93de14e24bf62af to your computer and use it in GitHub Desktop.
A modern way to read stdin in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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