Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/node:http/ClientRequest/writeMwritemethod
http.ClientRequest.write { console.log('Write completed, do more writes now.'); }); ``` A `Writable` stream in object mode will always ignore the `encoding` argument." data-algolia-static="false" data-algolia-merged="false" data-type="Method">write(chunk: any,callback?: (error: undefined | null | Error) => void): boolean;The writable.write() method writes some data to the stream, and calls the supplied callback once the data has been fully handled. If an error occurs, the callback will be called with the error as its first argument. The callback is called asynchronously and before 'error' is emitted.The return value is true if the internal buffer is less than the highWaterMark configured when the stream was created after admitting chunk. If false is returned, further attempts to write data to the stream should stop until the 'drain' event is emitted.While a stream is not draining, calls to write() will buffer chunk, and return false. Once all currently buffered chunks are drained (accepted for delivery by the operating system), the 'drain' event will be emitted. Once write() returns false, do not write more chunks until the 'drain' event is emitted. While calling write() on a stream that is not draining is allowed, Node.js will buffer all written chunks until maximum memory usage occurs, at which point it will abort unconditionally. Even before it aborts, high memory usage will cause poor garbage collector performance and high RSS (which is not typically released back to the system, even after the memory is no longer required). Since TCP sockets may never drain if the remote peer does not read the data, writing a socket that is not draining may lead to a remotely exploitable vulnerability.Writing data while the stream is not draining is particularly problematic for a Transform, because the Transform streams are paused by default until they are piped or a 'data' or 'readable' event handler is added.If the data to be written can be generated or fetched on demand, it is recommended to encapsulate the logic into a Readable and use pipe. However, if calling write() is preferred, it is possible to respect backpressure and avoid memory issues using the 'drain' event:function write(data, cb) { if (!stream.write(data)) { stream.once('drain', cb); } else { process.nextTick(cb); } } // Wait for cb to be called before doing any other write. write('hello', () => { console.log('Write completed, do more writes now.'); }); A Writable stream in object mode will always ignore the encoding argument.@param chunkOptional data to write. For streams not operating in object mode, chunk must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, chunk may be any JavaScript value other than null.@param callbackCallback for when this chunk of data is flushed.@returnsfalse if the stream wishes for the calling code to wait for the 'drain' event to be emitted before continuing to write additional data; otherwise true.write(chunk: any,encoding: BufferEncoding,callback?: (error: undefined | null | Error) => void): boolean;The writable.write() method writes some data to the stream, and calls the supplied callback once the data has been fully handled. If an error occurs, the callback will be called with the error as its first argument. The callback is called asynchronously and before 'error' is emitted.The return value is true if the internal buffer is less than the highWaterMark configured when the stream was created after admitting chunk. If false is returned, further attempts to write data to the stream should stop until the 'drain' event is emitted.While a stream is not draining, calls to write() will buffer chunk, and return false. Once all currently buffered chunks are drained (accepted for delivery by the operating system), the 'drain' event will be emitted. Once write() returns false, do not write more chunks until the 'drain' event is emitted. While calling write() on a stream that is not draining is allowed, Node.js will buffer all written chunks until maximum memory usage occurs, at which point it will abort unconditionally. Even before it aborts, high memory usage will cause poor garbage collector performance and high RSS (which is not typically released back to the system, even after the memory is no longer required). Since TCP sockets may never drain if the remote peer does not read the data, writing a socket that is not draining may lead to a remotely exploitable vulnerability.Writing data while the stream is not draining is particularly problematic for a Transform, because the Transform streams are paused by default until they are piped or a 'data' or 'readable' event handler is added.If the data to be written can be generated or fetched on demand, it is recommended to encapsulate the logic into a Readable and use pipe. However, if calling write() is preferred, it is possible to respect backpressure and avoid memory issues using the 'drain' event:function write(data, cb) { if (!stream.write(data)) { stream.once('drain', cb); } else { process.nextTick(cb); } } // Wait for cb to be called before doing any other write. write('hello', () => { console.log('Write completed, do more writes now.'); }); A Writable stream in object mode will always ignore the encoding argument.@param chunkOptional data to write. For streams not operating in object mode, chunk must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, chunk may be any JavaScript value other than null.@param encodingThe encoding, if chunk is a string.@param callbackCallback for when this chunk of data is flushed.@returnsfalse if the stream wishes for the calling code to wait for the 'drain' event to be emitted before continuing to write additional data; otherwise true.Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San FranciscoWe're hiring →智能索引记录
-
2026-03-02 11:32:39
综合导航
成功
标题:都市鉴宝之超级奶爸_我欲乘风2024_第十七章 本能抗拒_笔趣阁
简介:笔趣阁提供都市鉴宝之超级奶爸(我欲乘风2024)第十七章 本能抗拒在线阅读,所有小说均免费阅读,努力打造最干净的阅读环
-
2026-03-02 14:11:00
汽车交通
成功
标题:汽车的作文300字7篇(优秀)
简介:在平平淡淡的日常中,大家总少不了接触作文吧,作文是经过人的思想考虑和语言组织,通过文字来表达一个主题意义的记叙方法。那么
-
2026-03-02 18:54:11
数码科技
成功
标题:qq分组大全超拽女生范,超拽女生范-免费起名_免费取名_宝宝起名_起名软件_名字测试打分解名(缇帕电子科技)-起点起名网
简介:最新qq分组大全超拽女生范。一般的人的qq分组里也有好几个分组。对qq好友进行分组是因为在聊天的时候能更容易的找到,以下
-
2026-03-02 18:42:56
综合导航
成功
标题:沿ç¨çæ¼é³_沿ç¨çææ_沿ç¨çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½æ²¿ç¨é¢é,ä»ç»æ²¿ç¨,沿ç¨çæ¼é³,æ²¿ç¨æ¯
-
2026-03-02 16:36:04
综合导航
成功
标题:Navigating the Minnesota Family Law Landscape - Barna, Guzy & Steffen, LTD.
简介:Check out our blog as we navigate the landscape of family la
-
2026-03-02 15:38:42
综合导航
成功
标题:Danielle Grennan Associate Director, Regulatory and Public Policy, Ernst & Young LLP EY Indonesia
简介:<p>Danielle has over 12 years’ experience in the regulatory
-
2026-03-02 18:48:30
综合导航
成功
标题:出纳凭证实操-会计实操-实务问答-高顿会计出纳凭证问答
简介:高顿问答为您提供出纳凭证实操问答,并且提供会计问答、财会问答、会计实务问答、包含注册会计师、CFA、会计实操、初中级会计
-
2026-03-02 18:55:16
综合导航
成功
标题:å°èéªè¤çæ¼é³_å°èéªè¤çææ_å°èéªè¤çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½å°èéªè¤é¢é,ä»ç»å°èéªè¤,å°èéªè¤ç
-
2026-03-02 16:38:52
综合导航
成功
标题:姐夫bywing最新章节_姐夫bywing全文免费阅读_恋上你看书网
简介:他曾经是她的恋人,但是为了毋亲的十几万手术费,她单方面提了分手,从此在他的世界里消失。再见之时,他成了她的姐夫…本来以为
-
2026-03-02 11:42:04
综合导航
成功
标题:Monochrome Mahjongg - Play The Free Mobile Game Online
简介:Monochrome Mahjongg - click to play online. Monochrome Mahjo
-
2026-03-02 16:50:52
旅游出行
成功
标题:网站建设推荐频道自己注册公司一年多少费用-北京孤凡电子商务有限公司
简介:网站建设推荐频道,自己注册公司一年多少费用,app开发软件怎么做,wordpress qvanxian旧Mac升级全攻略
-
2026-03-02 12:41:18
实用工具
成功
标题:仓库出入库记录表-果果圈模板
简介:仓库出入库记录表,表格简单实用,记录物资出入库情况,掌控仓库物资数量,方便核对,欢迎下载。
-
2026-03-02 16:52:50
综合导航
成功
标题:五一网 51游戏_好玩的游戏社区化平台_51游戏官网 51页游 空间尽在51.com
简介:玩游戏,上51.COM。51游戏平台是国内知名的专业游戏社区化平台,在这里玩家们可以尽情体验畅玩游戏、讨论游戏、共创游戏
-
2026-03-02 16:15:32
综合导航
成功
标题:Cimon of Cleonae. The Reader's Biographical Encyclopaedia. 1922
简介:Cimon of Cleonae. The Reader
-
2026-03-02 16:41:43
综合导航
成功
标题:æ©æçæ¼é³_æ©æçææ_æ©æçç¹ä½_è¯ç»ç½
简介:è¯ç»ç½æ©æé¢é,ä»ç»æ©æ,æ©æçæ¼é³,æ©ææ¯
-
2026-03-02 16:51:45
综合导航
成功
标题:Looking for the next UNI? Check out 5 unsold Perp DEX projects worth paying attention to Bee Network
简介:This is undoubtedly the most profitable track in 2025. Sinc
-
2026-03-02 16:38:02
综合导航
成功
标题:æå°çæ¼é³_æå°çææ_æå°çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½æå°é¢é,ä»ç»æå°,æå°çæ¼é³,æå°æ¯
-
2026-03-02 11:28:48
综合导航
成功
标题:长歌英雄曲目录最新章节_长歌英雄曲全文免费阅读_风云中文网
简介:长歌英雄曲目录最新章节由网友提供,《长歌英雄曲》情节跌宕起伏、扣人心弦,是一本情节与文笔俱佳的风云中文网,风云中文网免费
-
2026-03-02 16:40:07
游戏娱乐
成功
标题:头脑特工队救大象,头脑特工队救大象小游戏,4399小游戏 www.4399.com
简介:头脑特工队救大象在线玩,头脑特工队救大象下载, 头脑特工队救大象攻略秘籍.更多头脑特工队救大象游戏尽在4399小游戏,好
-
2026-03-02 14:13:01
教育培训
成功
标题:【必备】高中的作文锦集五篇
简介:在生活、工作和学习中,大家都不可避免地要接触到作文吧,作文根据体裁的不同可以分为记叙文、说明文、应用文、议论文。相信很多
-
2026-03-02 18:55:08
综合导航
成功
标题:æ²ç»è¯_æ²åç»è¯_è¯ç»ç½
简介:è¯ç»ç½æ²ç»è¯é¢é,æä¾å ³äºæ²ç»è¯ç¸å ³è¯è¯,æ
-
2026-03-02 16:13:53
汽车交通
成功
标题:荷塘区虎宜浴巾股份有限公司
简介:荷塘区虎宜浴巾股份有限公司www.hnseyzx.com经营范围含:化工废料、纸浆、闸门工程、家具制造机械、种牛、交通用
-
2026-03-02 15:28:59
综合导航
成功
标题:没有你要找的内容 مکھیوں کا نیٹ ورک
简介:آپ جو سب سے اچھی ویب سائٹ جانتے ہیں وہ ہمیں شیئر کریں۔
-
2026-03-02 18:41:45
综合导航
成功
标题:Captain John Smith (1580-1631). The Reader's Biographical Encyclopaedia. 1922
简介:Captain John Smith (1580-1631). The Reader
-
2026-03-02 12:15:21
综合导航
成功
标题:不消的拼音_不消的意思_不消的繁体_词组网
简介:词组网不消频道,介绍不消,不消的拼音,不消是什么意思,不消的意思,不消的繁体,不消怎么读,不消的近义词,不消的反义词。
-
2026-03-02 18:49:27
综合导航
成功
标题:当你眼睛眯着笑下一句最新章节_第23章第1页_当你眼睛眯着笑下一句免费章节_恋上你看书网
简介:第23章第1页_当你眼睛眯着笑下一句_花间树里_恋上你看书网
-
2026-03-02 12:12:05
综合导航
成功
标题:IVC Podcast - Episode 1 - Activate Engagement OS — Invision
简介:Over the past 18 months, marketers have rapidly transformed
-
2026-03-02 16:39:33
综合导航
成功
标题:æä»·çæ¼é³_æä»·çææ_æä»·çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½æä»·é¢é,ä»ç»æä»·,æä»·çæ¼é³,æä»·æ¯
-
2026-03-02 18:49:43
综合导航
成功
标题:Купити папуги Амазона в Україні RIA.com
简介:Оголошення про продаж папуг Амазонів за доступними цінами. П
-
2026-03-02 16:59:27
综合导航
成功
标题:Weekly Editor’s Picks (1018-1024) Bee Network
简介:Therefore, every Saturday, our editorial department will sel