标签: node.js stream stdin
使用用户交互式输入时是否可以获得标准输入内容?
const readline = require('readline') readline.emitKeypressEvents(process.stdin) process.stdin.setRawMode(true) // this is important process.stdin.setEncoding('utf8') process.stdin.read() // null