当前位置:网站首页>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边栏推荐
- Agency mode -- Jiangnan leather shoes factory
- Leetcode (135) - distribute candy
- Variable setting in postman
- How to enhance influence
- Image panr
- Network security review office starts network security review on HowNet
- 物联网?快来看 Arduino 上云啦
- JUnit unit test
- [performance tuning basics] performance tuning strategy
- Leetcode(146)——LRU 缓存
猜你喜欢

What are the problems with traditional IO? Why is zero copy introduced?

What does virtualization mean? What technologies are included? What is the difference with private cloud?

How to apply agile development ideas to other work

Material management system based on SSM (source code + document + database)

Sequence stack version 1.0

图的基本概念以及相关定义

物联网?快来看 Arduino 上云啦

Internet of things? Come and see Arduino on the cloud

Nifi fast authentication configuration

微信小程序中使用vant组件
随机推荐
Use the transparent [x] cross button image in the dialog
Leetcode(455)——分发饼干
DX12引擎开发课程进度-这个课程到底讲到哪里了
Second understanding permutation and combination
Steps of JMeter performance test
Leetcode (146) - LRU cache
Berkeley, MIT, Cambridge, deepmind et d'autres grandes conférences en ligne: vers une IA sûre, fiable et contrôlable
图的基本概念以及相关定义
Summary of idea practical skills: how to rename a project or module to completely solve all the problems you encounter that do not work. It is suggested that the five-star collection be your daughter
Docker deploy mysql5.7
Bridging mode -- law firm
Mr. Hu Bo, CIO of weiduomei, a scientific innovator: digitalization is a bloodless revolution, and the correct answer lies in the field of business
Sequence stack version 1.0
Byte and Tencent have also come to an end. How fragrant is this business of "making 30million yuan a month"?
史上最全DPU厂商大盘点(上)
物联网?快来看 Arduino 上云啦
Bytebase joins Alibaba cloud polardb open source database community
Leetcode(135)——分发糖果
伯克利、MIT、劍橋、DeepMind等業內大佬線上講座:邁向安全可靠可控的AI
Variable setting in postman
