当前位置:网站首页>Read all text from stdin to a string
Read all text from stdin to a string
2022-06-24 21:04:00 【Technology feast】
problem :
I'm writing a program in Node.js that (in some situations) wants to act as a simple filter: read everything from stdin (up to end of file), do some processing, write the result to stdout. I'm using Node.js Write a program , it ( In some cases ) Hope to act as a simple filter : From standard input ( Until the end of the file ) Read everything , Do some processing , Write results to standard output .
How do you do the 'read everything from stdin' part? How do you do “ Read everything from standard input ” part ?The closest solutions I've found so far, seem to work either for one line at a time from the console, or else only work when stdin is a file not a pipe. up to now , The closest solution I've found seems to run one line at a time from the console , Or only in stdin Works when it is a file, not a pipe .
Solution :
Reference resources : https://stackoom.com/en/question/23j6H边栏推荐
- Basic operation of sequence table
- Talking about the range of data that MySQL update will lock
- How Fiddler works
- Builder mode -- Master asked me to refine pills
- After screwing the screws in the factory for two years, I earned more than 10000 yuan a month by "testing" and counterattacked
- opds sql组件能不能将流程参数通过上下文传给下一个组件
- 图像PANR
- Leetcode(146)——LRU 缓存
- Set up your own website (14)
- [performance tuning basics] performance tuning standards
猜你喜欢

After a few years in the testing industry, do you still know a little?

Sequence stack version 1.0

Set up your own website (14)

虚拟化是什么意思?包含哪些技术?与私有云有什么区别?

Interpreter mode -- formulas for dating

Basic concepts and definitions of Graphs

The JS method parameter passed a number beginning with 0. A magical problem occurred and bothered me for a long time

Basic properties and ergodicity of binary tree

Bean lifecycle flowchart

A/B测试助力游戏业务增长
随机推荐
"Super point" in "Meng Hua Lu", is the goose wronged?
Freshman girls' nonsense programming is popular! Those who understand programming are tied with Q after reading
The Network Security Review Office launched a network security review on HowNet, saying that it "has a large amount of important data and sensitive information"
JUnit unit test
Implement the redis simple client customized based on socket
Haitai Advanced Technology | application of privacy computing technology in medical data protection
The difference between RPC and restful
IDEA Dashboard
JMeter installation plug-in, adding [email protected] -Perfmon metric collector listener steps
The AI for emotion recognition was "harbouring evil intentions", and Microsoft decided to block it!
Mapstacks: data normalization and layered color layer loading
虚拟化是什么意思?包含哪些技术?与私有云有什么区别?
Sequence stack version 1.0
Several common command operations in win system
海泰前沿技术|隐私计算技术在医疗数据保护中的应用
Popupwindow touch event transparent transmission scheme
Mr. Hu Bo, CIO of weiduomei, a scientific innovator: digitalization is a bloodless revolution, and the correct answer lies in the field of business
Common data model (updating)
Leetcode(146)——LRU 缓存
Simpledateformat thread unsafe
