@codebolt/codeboltjs 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/Readme.md +47 -0
  2. package/{modules → dist}/agentlib/agent.js +4 -4
  3. package/{modules → dist}/agentlib/usermessage.js +3 -3
  4. package/dist/core/messageManager.d.ts +47 -0
  5. package/dist/core/messageManager.js +128 -0
  6. package/{modules → dist/core}/websocket.d.ts +5 -0
  7. package/{modules → dist/core}/websocket.js +13 -9
  8. package/{index.d.ts → dist/index.d.ts} +42 -53
  9. package/{index.js → dist/index.js} +49 -4
  10. package/dist/modules/agent.js +79 -0
  11. package/{modules → dist/modules}/browser.d.ts +7 -7
  12. package/dist/modules/browser.js +211 -0
  13. package/{modules → dist/modules}/chat.d.ts +8 -20
  14. package/dist/modules/chat.js +162 -0
  15. package/{modules → dist/modules}/codeutils.d.ts +1 -1
  16. package/dist/modules/codeutils.js +89 -0
  17. package/{modules → dist/modules}/crawler.d.ts +1 -16
  18. package/dist/modules/crawler.js +64 -0
  19. package/dist/modules/dbmemory.js +38 -0
  20. package/dist/modules/debug.js +48 -0
  21. package/{modules → dist/modules}/fs.d.ts +1 -1
  22. package/dist/modules/fs.js +184 -0
  23. package/dist/modules/git.js +152 -0
  24. package/{modules → dist/modules}/history.js +11 -27
  25. package/{modules → dist/modules}/llm.js +8 -16
  26. package/{modules → dist/modules}/project.d.ts +1 -1
  27. package/dist/modules/project.js +48 -0
  28. package/dist/modules/state.js +69 -0
  29. package/dist/modules/task.js +51 -0
  30. package/{modules → dist/modules}/terminal.d.ts +3 -2
  31. package/{modules → dist/modules}/terminal.js +36 -47
  32. package/dist/modules/tokenizer.js +40 -0
  33. package/{modules → dist/modules}/tools.d.ts +0 -6
  34. package/dist/modules/tools.js +117 -0
  35. package/dist/modules/utils.js +22 -0
  36. package/dist/modules/vectordb.js +71 -0
  37. package/dist/utils.d.ts +5 -0
  38. package/{utils.js → dist/utils.js} +5 -5
  39. package/package.json +17 -8
  40. package/.codebolt/chat.json +0 -1
  41. package/.codebolt/debug.json +0 -1
  42. package/.codebolt/projectState.json +0 -127
  43. package/.codebolt/tasks.json +0 -1
  44. package/.codeboltconfig.yaml +0 -0
  45. package/.github/workflows/publish-to-npm.yml +0 -20
  46. package/bkp/toolBox.bkp.ts +0 -1162
  47. package/docs/.nojekyll +0 -1
  48. package/docs/assets/highlight.css +0 -127
  49. package/docs/assets/icons.js +0 -15
  50. package/docs/assets/icons.svg +0 -1
  51. package/docs/assets/main.js +0 -59
  52. package/docs/assets/navigation.js +0 -1
  53. package/docs/assets/search.js +0 -1
  54. package/docs/assets/style.css +0 -1412
  55. package/docs/classes/_internal_.Agent.html +0 -318
  56. package/docs/classes/_internal_.AsyncResource.html +0 -44
  57. package/docs/classes/_internal_.Blob.html +0 -33
  58. package/docs/classes/_internal_.ClientRequest.html +0 -506
  59. package/docs/classes/_internal_.Codebolt.html +0 -315
  60. package/docs/classes/_internal_.CustomEventEmitter-1.html +0 -248
  61. package/docs/classes/_internal_.CustomEventEmitter.html +0 -248
  62. package/docs/classes/_internal_.Duplex.html +0 -690
  63. package/docs/classes/_internal_.EventEmitter-1.html +0 -254
  64. package/docs/classes/_internal_.EventEmitter.EventEmitterAsyncResource.html +0 -268
  65. package/docs/classes/_internal_.IncomingMessage.html +0 -661
  66. package/docs/classes/_internal_.KeyObject.html +0 -76
  67. package/docs/classes/_internal_.OutgoingMessage.html +0 -491
  68. package/docs/classes/_internal_.Readable.html +0 -551
  69. package/docs/classes/_internal_.ReadableBase.html +0 -551
  70. package/docs/classes/_internal_.Server-1.html +0 -416
  71. package/docs/classes/_internal_.Server-2.html +0 -326
  72. package/docs/classes/_internal_.Server-3.html +0 -353
  73. package/docs/classes/_internal_.Server.html +0 -390
  74. package/docs/classes/_internal_.ServerResponse.html +0 -569
  75. package/docs/classes/_internal_.Socket.html +0 -791
  76. package/docs/classes/_internal_.Stream.html +0 -256
  77. package/docs/classes/_internal_.TLSSocket.html +0 -947
  78. package/docs/classes/_internal_.URL.html +0 -140
  79. package/docs/classes/_internal_.URLSearchParams.html +0 -68
  80. package/docs/classes/_internal_.WebSocket-1.html +0 -297
  81. package/docs/classes/_internal_.WebSocket.Server.html +0 -261
  82. package/docs/classes/_internal_.Writable.html +0 -394
  83. package/docs/classes/_internal_.WritableBase.html +0 -394
  84. package/docs/classes/_internal_.X509Certificate.html +0 -144
  85. package/docs/classes/_internal_.internal-1.html +0 -256
  86. package/docs/classes/_internal_.internal.PassThrough.html +0 -686
  87. package/docs/classes/_internal_.internal.Transform.html +0 -693
  88. package/docs/enums/_internal_.logType.html +0 -4
  89. package/docs/functions/_internal_.WebSocket.createWebSocketStream.html +0 -1
  90. package/docs/functions/_internal_._node_stream_consumers_.arrayBuffer.html +0 -1
  91. package/docs/functions/_internal_._node_stream_consumers_.blob.html +0 -1
  92. package/docs/functions/_internal_._node_stream_consumers_.buffer.html +0 -1
  93. package/docs/functions/_internal_._node_stream_consumers_.json.html +0 -1
  94. package/docs/functions/_internal_._node_stream_consumers_.text.html +0 -1
  95. package/docs/functions/_internal_._node_stream_promises_.finished.html +0 -1
  96. package/docs/functions/_internal_._node_stream_promises_.pipeline.html +0 -1
  97. package/docs/functions/_internal_.internal.addAbortSignal.html +0 -17
  98. package/docs/functions/_internal_.internal.finished-1.html +0 -20
  99. package/docs/functions/_internal_.internal.finished.__promisify__.html +0 -1
  100. package/docs/functions/_internal_.internal.getDefaultHighWaterMark.html +0 -4
  101. package/docs/functions/_internal_.internal.isErrored.html +0 -3
  102. package/docs/functions/_internal_.internal.isReadable.html +0 -3
  103. package/docs/functions/_internal_.internal.pipeline-1.html +0 -24
  104. package/docs/functions/_internal_.internal.pipeline.__promisify__.html +0 -1
  105. package/docs/functions/_internal_.internal.setDefaultHighWaterMark.html +0 -4
  106. package/docs/hierarchy.html +0 -1
  107. package/docs/index.html +0 -12
  108. package/docs/interfaces/_internal_.AddToAgentStateResponse.html +0 -3
  109. package/docs/interfaces/_internal_.AddTokenResponse.html +0 -3
  110. package/docs/interfaces/_internal_.AddVectorItemResponse.html +0 -3
  111. package/docs/interfaces/_internal_.AddressInfo.html +0 -4
  112. package/docs/interfaces/_internal_.AgentOptions.html +0 -35
  113. package/docs/interfaces/_internal_.ApplicationState.html +0 -4
  114. package/docs/interfaces/_internal_.ArrayBufferView.html +0 -7
  115. package/docs/interfaces/_internal_.ArrayLike.html +0 -2
  116. package/docs/interfaces/_internal_.ArrayOptions.html +0 -7
  117. package/docs/interfaces/_internal_.AsymmetricKeyDetails.html +0 -15
  118. package/docs/interfaces/_internal_.AsyncGenerator.html +0 -5
  119. package/docs/interfaces/_internal_.AsyncGeneratorFunction.html +0 -12
  120. package/docs/interfaces/_internal_.AsyncIterable.html +0 -2
  121. package/docs/interfaces/_internal_.AsyncIterableIterator.html +0 -5
  122. package/docs/interfaces/_internal_.AsyncIterator.html +0 -4
  123. package/docs/interfaces/_internal_.AsyncResourceOptions.html +0 -12
  124. package/docs/interfaces/_internal_.BlobOptions.html +0 -8
  125. package/docs/interfaces/_internal_.Buffer.html +0 -760
  126. package/docs/interfaces/_internal_.BufferConstructor.html +0 -165
  127. package/docs/interfaces/_internal_.Certificate.html +0 -13
  128. package/docs/interfaces/_internal_.ChatMessage.html +0 -3
  129. package/docs/interfaces/_internal_.Choice.html +0 -5
  130. package/docs/interfaces/_internal_.CipherNameAndProtocol.html +0 -7
  131. package/docs/interfaces/_internal_.ClientRequestArgs.html +0 -28
  132. package/docs/interfaces/_internal_.CommandError.html +0 -3
  133. package/docs/interfaces/_internal_.CommonConnectionOptions.html +0 -29
  134. package/docs/interfaces/_internal_.ConnectOpts.html +0 -5
  135. package/docs/interfaces/_internal_.CreateFileResponse.html +0 -6
  136. package/docs/interfaces/_internal_.CreateFolderResponse.html +0 -6
  137. package/docs/interfaces/_internal_.CryptoKey.html +0 -26
  138. package/docs/interfaces/_internal_.DebugAddLogResponse.html +0 -4
  139. package/docs/interfaces/_internal_.DeleteFileResponse.html +0 -6
  140. package/docs/interfaces/_internal_.DeleteFolderResponse.html +0 -6
  141. package/docs/interfaces/_internal_.DetailedPeerCertificate.html +0 -53
  142. package/docs/interfaces/_internal_.Dict.html +0 -1
  143. package/docs/interfaces/_internal_.Disposable.html +0 -2
  144. package/docs/interfaces/_internal_.DropArgument.html +0 -7
  145. package/docs/interfaces/_internal_.DuplexOptions.html +0 -22
  146. package/docs/interfaces/_internal_.EphemeralKeyInfo.html +0 -7
  147. package/docs/interfaces/_internal_.ErrnoException.html +0 -8
  148. package/docs/interfaces/_internal_.Error.html +0 -4
  149. package/docs/interfaces/_internal_.EventEmitter-2.html +0 -130
  150. package/docs/interfaces/_internal_.EventEmitter.Abortable.html +0 -3
  151. package/docs/interfaces/_internal_.EventEmitter.EventEmitterAsyncResourceOptions.html +0 -19
  152. package/docs/interfaces/_internal_.EventEmitter.EventEmitterReferencingAsyncResource.html +0 -32
  153. package/docs/interfaces/_internal_.EventEmitterOptions.html +0 -3
  154. package/docs/interfaces/_internal_.ExtractTextResponse.html +0 -3
  155. package/docs/interfaces/_internal_.GetAgentStateResponse.html +0 -3
  156. package/docs/interfaces/_internal_.GetContentResponse.html +0 -3
  157. package/docs/interfaces/_internal_.GetMarkdownResponse.html +0 -3
  158. package/docs/interfaces/_internal_.GetMatcherListTreeResponse.html +0 -3
  159. package/docs/interfaces/_internal_.GetProjectPathResponse.html +0 -5
  160. package/docs/interfaces/_internal_.GetTokenResponse.html +0 -3
  161. package/docs/interfaces/_internal_.GetVectorResponse.html +0 -3
  162. package/docs/interfaces/_internal_.GoToPageResponse.html +0 -3
  163. package/docs/interfaces/_internal_.HtmlReceived.html +0 -3
  164. package/docs/interfaces/_internal_.IncomingHttpHeaders.html +0 -64
  165. package/docs/interfaces/_internal_.InformationEvent.html +0 -8
  166. package/docs/interfaces/_internal_.IpcSocketConnectOpts.html +0 -6
  167. package/docs/interfaces/_internal_.Iterable.html +0 -2
  168. package/docs/interfaces/_internal_.IterableIterator.html +0 -5
  169. package/docs/interfaces/_internal_.Iterator.html +0 -4
  170. package/docs/interfaces/_internal_.IteratorReturnResult.html +0 -3
  171. package/docs/interfaces/_internal_.IteratorYieldResult.html +0 -3
  172. package/docs/interfaces/_internal_.JsonWebKey.html +0 -14
  173. package/docs/interfaces/_internal_.JwkKeyExportOptions.html +0 -2
  174. package/docs/interfaces/_internal_.KeyAlgorithm.html +0 -2
  175. package/docs/interfaces/_internal_.KeyExportOptions.html +0 -5
  176. package/docs/interfaces/_internal_.KeyObject-1.html +0 -5
  177. package/docs/interfaces/_internal_.LLMResponse.html +0 -4
  178. package/docs/interfaces/_internal_.ListenOptions.html +0 -13
  179. package/docs/interfaces/_internal_.LookupAddress.html +0 -6
  180. package/docs/interfaces/_internal_.LookupOptions.html +0 -27
  181. package/docs/interfaces/_internal_.MatchProblemResponse.html +0 -3
  182. package/docs/interfaces/_internal_.MemoryGetResponse.html +0 -5
  183. package/docs/interfaces/_internal_.MemorySetResponse.html +0 -5
  184. package/docs/interfaces/_internal_.Message.html +0 -8
  185. package/docs/interfaces/_internal_.MessageContent.html +0 -3
  186. package/docs/interfaces/_internal_.Object.html +0 -18
  187. package/docs/interfaces/_internal_.OnReadOpts.html +0 -6
  188. package/docs/interfaces/_internal_.OpenDebugBrowserResponse.html +0 -4
  189. package/docs/interfaces/_internal_.OutgoingHttpHeaders.html +0 -80
  190. package/docs/interfaces/_internal_.PeerCertificate.html +0 -50
  191. package/docs/interfaces/_internal_.PromiseLike.html +0 -6
  192. package/docs/interfaces/_internal_.PxfObject.html +0 -5
  193. package/docs/interfaces/_internal_.QueryVectorItemResponse.html +0 -3
  194. package/docs/interfaces/_internal_.QueuingStrategy.html +0 -3
  195. package/docs/interfaces/_internal_.QueuingStrategySize.html +0 -1
  196. package/docs/interfaces/_internal_.ReadFileResponse.html +0 -7
  197. package/docs/interfaces/_internal_.ReadOnlyDict.html +0 -1
  198. package/docs/interfaces/_internal_.ReadWriteStream.html +0 -144
  199. package/docs/interfaces/_internal_.ReadableByteStreamController.html +0 -6
  200. package/docs/interfaces/_internal_.ReadableByteStreamControllerCallback.html +0 -1
  201. package/docs/interfaces/_internal_.ReadableOptions.html +0 -11
  202. package/docs/interfaces/_internal_.ReadableStream-1.html +0 -141
  203. package/docs/interfaces/_internal_.ReadableStream.html +0 -10
  204. package/docs/interfaces/_internal_.ReadableStreamBYOBReader.html +0 -5
  205. package/docs/interfaces/_internal_.ReadableStreamDefaultController.html +0 -5
  206. package/docs/interfaces/_internal_.ReadableStreamDefaultReadDoneResult.html +0 -3
  207. package/docs/interfaces/_internal_.ReadableStreamDefaultReadValueResult.html +0 -3
  208. package/docs/interfaces/_internal_.ReadableStreamDefaultReader.html +0 -5
  209. package/docs/interfaces/_internal_.ReadableStreamErrorCallback.html +0 -1
  210. package/docs/interfaces/_internal_.ReadableStreamGenericReader.html +0 -3
  211. package/docs/interfaces/_internal_.ReadableStreamReadDoneResult.html +0 -3
  212. package/docs/interfaces/_internal_.ReadableStreamReadValueResult.html +0 -3
  213. package/docs/interfaces/_internal_.ReadableWritablePair.html +0 -9
  214. package/docs/interfaces/_internal_.SecureContext.html +0 -2
  215. package/docs/interfaces/_internal_.SecureContextOptions.html +0 -121
  216. package/docs/interfaces/_internal_.Selection.html +0 -6
  217. package/docs/interfaces/_internal_.ServerOptions.html +0 -64
  218. package/docs/interfaces/_internal_.ServerOpts.html +0 -25
  219. package/docs/interfaces/_internal_.SharedArrayBuffer.html +0 -7
  220. package/docs/interfaces/_internal_.SharedArrayBufferConstructor.html +0 -3
  221. package/docs/interfaces/_internal_.SocketConstructorOpts.html +0 -6
  222. package/docs/interfaces/_internal_.StaticEventEmitterOptions.html +0 -15
  223. package/docs/interfaces/_internal_.StreamOptions.html +0 -9
  224. package/docs/interfaces/_internal_.StreamPipeOptions.html +0 -37
  225. package/docs/interfaces/_internal_.TLSSocketOptions.html +0 -160
  226. package/docs/interfaces/_internal_.TcpSocketConnectOpts.html +0 -19
  227. package/docs/interfaces/_internal_.TerminalInterruptResponse.html +0 -3
  228. package/docs/interfaces/_internal_.TlsOptions.html +0 -197
  229. package/docs/interfaces/_internal_.UnderlyingByteSource.html +0 -6
  230. package/docs/interfaces/_internal_.UnderlyingSink.html +0 -6
  231. package/docs/interfaces/_internal_.UnderlyingSinkAbortCallback.html +0 -1
  232. package/docs/interfaces/_internal_.UnderlyingSinkCloseCallback.html +0 -1
  233. package/docs/interfaces/_internal_.UnderlyingSinkStartCallback.html +0 -1
  234. package/docs/interfaces/_internal_.UnderlyingSinkWriteCallback.html +0 -1
  235. package/docs/interfaces/_internal_.UnderlyingSource.html +0 -5
  236. package/docs/interfaces/_internal_.UnderlyingSourceCancelCallback.html +0 -1
  237. package/docs/interfaces/_internal_.UnderlyingSourcePullCallback.html +0 -1
  238. package/docs/interfaces/_internal_.UnderlyingSourceStartCallback.html +0 -1
  239. package/docs/interfaces/_internal_.UpdateFileResponse.html +0 -6
  240. package/docs/interfaces/_internal_.UrlResponse.html +0 -3
  241. package/docs/interfaces/_internal_.Usage-1.html +0 -4
  242. package/docs/interfaces/_internal_.Usage.html +0 -4
  243. package/docs/interfaces/_internal_.UserMessage.html +0 -3
  244. package/docs/interfaces/_internal_.UserRequest.html +0 -7
  245. package/docs/interfaces/_internal_.WebSocket.AddressInfo.html +0 -4
  246. package/docs/interfaces/_internal_.WebSocket.ClientOptions.html +0 -138
  247. package/docs/interfaces/_internal_.WebSocket.CloseEvent.html +0 -6
  248. package/docs/interfaces/_internal_.WebSocket.ErrorEvent.html +0 -5
  249. package/docs/interfaces/_internal_.WebSocket.Event.html +0 -3
  250. package/docs/interfaces/_internal_.WebSocket.EventListenerOptions.html +0 -2
  251. package/docs/interfaces/_internal_.WebSocket.MessageEvent.html +0 -4
  252. package/docs/interfaces/_internal_.WebSocket.PerMessageDeflateOptions.html +0 -9
  253. package/docs/interfaces/_internal_.WebSocket.ServerOptions.html +0 -14
  254. package/docs/interfaces/_internal_.WebSocket.WebSocket.html +0 -172
  255. package/docs/interfaces/_internal_.WebSocket.WebSocketServer.html +0 -144
  256. package/docs/interfaces/_internal_.WebSocketAlias.html +0 -172
  257. package/docs/interfaces/_internal_.WritableOptions.html +0 -14
  258. package/docs/interfaces/_internal_.WritableStream-1.html +0 -8
  259. package/docs/interfaces/_internal_.WritableStream.html +0 -133
  260. package/docs/interfaces/_internal_.WritableStreamDefaultController.html +0 -6
  261. package/docs/interfaces/_internal_.WritableStreamDefaultWriter.html +0 -12
  262. package/docs/interfaces/_internal_.X509CheckOptions.html +0 -16
  263. package/docs/interfaces/_internal_.ZlibOptions.html +0 -21
  264. package/docs/interfaces/_internal_.getMatchDetail.html +0 -3
  265. package/docs/interfaces/_internal_.internal.FinishedOptions.html +0 -6
  266. package/docs/interfaces/_internal_.internal.Pipe.html +0 -5
  267. package/docs/interfaces/_internal_.internal.PipelineOptions.html +0 -3
  268. package/docs/interfaces/_internal_.internal.TransformOptions.html +0 -24
  269. package/docs/modules/_internal_.EventEmitter.html +0 -6
  270. package/docs/modules/_internal_.WebSocket.html +0 -21
  271. package/docs/modules/_internal_._node_stream_consumers_.html +0 -6
  272. package/docs/modules/_internal_._node_stream_promises_.html +0 -3
  273. package/docs/modules/_internal_.html +0 -228
  274. package/docs/modules/_internal_.internal.finished.html +0 -2
  275. package/docs/modules/_internal_.internal.html +0 -36
  276. package/docs/modules/_internal_.internal.pipeline.html +0 -2
  277. package/docs/modules.html +0 -3
  278. package/docs/types/_internal_.AnyRest.html +0 -1
  279. package/docs/types/_internal_.Args.html +0 -1
  280. package/docs/types/_internal_.ArrayBufferLike.html +0 -1
  281. package/docs/types/_internal_.ArrayBufferView-1.html +0 -1
  282. package/docs/types/_internal_.BinaryLike.html +0 -1
  283. package/docs/types/_internal_.BufferEncoding.html +0 -1
  284. package/docs/types/_internal_.BufferLike.html +0 -1
  285. package/docs/types/_internal_.ComposeFnParam.html +0 -1
  286. package/docs/types/_internal_.DefaultEventMap.html +0 -1
  287. package/docs/types/_internal_.EventMap.html +0 -1
  288. package/docs/types/_internal_.InstanceType.html +0 -2
  289. package/docs/types/_internal_.IteratorResult.html +0 -1
  290. package/docs/types/_internal_.Key.html +0 -1
  291. package/docs/types/_internal_.Key2.html +0 -1
  292. package/docs/types/_internal_.KeyFormat.html +0 -1
  293. package/docs/types/_internal_.KeyObjectType.html +0 -1
  294. package/docs/types/_internal_.KeyType-1.html +0 -1
  295. package/docs/types/_internal_.KeyType.html +0 -1
  296. package/docs/types/_internal_.KeyUsage.html +0 -1
  297. package/docs/types/_internal_.Listener.html +0 -1
  298. package/docs/types/_internal_.LookupFunction.html +0 -1
  299. package/docs/types/_internal_.OutgoingHttpHeader.html +0 -1
  300. package/docs/types/_internal_.Partial.html +0 -2
  301. package/docs/types/_internal_.Pick.html +0 -2
  302. package/docs/types/_internal_.PropertyKey.html +0 -1
  303. package/docs/types/_internal_.ReadableStreamController.html +0 -1
  304. package/docs/types/_internal_.ReadableStreamDefaultReadResult.html +0 -1
  305. package/docs/types/_internal_.ReadableStreamReadResult.html +0 -1
  306. package/docs/types/_internal_.Record.html +0 -2
  307. package/docs/types/_internal_.RequestListener.html +0 -1
  308. package/docs/types/_internal_.SecureVersion.html +0 -1
  309. package/docs/types/_internal_.ServerOptions-1.html +0 -1
  310. package/docs/types/_internal_.SocketConnectOpts.html +0 -1
  311. package/docs/types/_internal_.SocketReadyState.html +0 -1
  312. package/docs/types/_internal_.TypedArray.html +0 -1
  313. package/docs/types/_internal_.WebSocket.CertMeta.html +0 -2
  314. package/docs/types/_internal_.WebSocket.Data.html +0 -2
  315. package/docs/types/_internal_.WebSocket.RawData.html +0 -2
  316. package/docs/types/_internal_.WebSocket.VerifyClientCallbackAsync.html +0 -4
  317. package/docs/types/_internal_.WebSocket.VerifyClientCallbackSync.html +0 -4
  318. package/docs/types/_internal_.WithImplicitCoercion.html +0 -1
  319. package/docs/types/_internal_.internal.PipelineCallback.html +0 -1
  320. package/docs/types/_internal_.internal.PipelineDestination.html +0 -1
  321. package/docs/types/_internal_.internal.PipelineDestinationIterableFunction.html +0 -1
  322. package/docs/types/_internal_.internal.PipelineDestinationPromiseFunction.html +0 -1
  323. package/docs/types/_internal_.internal.PipelinePromise.html +0 -1
  324. package/docs/types/_internal_.internal.PipelineSource.html +0 -1
  325. package/docs/types/_internal_.internal.PipelineSourceFunction.html +0 -1
  326. package/docs/types/_internal_.internal.PipelineTransform.html +0 -1
  327. package/docs/types/_internal_.internal.PipelineTransformSource.html +0 -1
  328. package/docs/types/_internal_.internal.TransformCallback.html +0 -1
  329. package/docs/variables/_internal_.Buffer-1.html +0 -1
  330. package/docs/variables/_internal_.Error-1.html +0 -1
  331. package/docs/variables/_internal_.Object-1.html +0 -2
  332. package/docs/variables/_internal_.ReadableByteStreamController-1.html +0 -1
  333. package/docs/variables/_internal_.ReadableStream-2.html +0 -1
  334. package/docs/variables/_internal_.ReadableStreamBYOBReader-1.html +0 -1
  335. package/docs/variables/_internal_.ReadableStreamDefaultController-1.html +0 -1
  336. package/docs/variables/_internal_.ReadableStreamDefaultReader-1.html +0 -1
  337. package/docs/variables/_internal_.SharedArrayBuffer-1.html +0 -1
  338. package/docs/variables/_internal_.WebSocket.WebSocket-1.html +0 -1
  339. package/docs/variables/_internal_.WebSocket.WebSocketServer-1.html +0 -1
  340. package/docs/variables/_internal_.WebSocketAlias-1.html +0 -1
  341. package/docs/variables/_internal_.WritableStream-2.html +0 -1
  342. package/docs/variables/_internal_.WritableStreamDefaultController-1.html +0 -1
  343. package/docs/variables/_internal_.WritableStreamDefaultWriter-1.html +0 -1
  344. package/docs/variables/_internal_.internal.consumers.html +0 -1
  345. package/docs/variables/_internal_.internal.promises.html +0 -1
  346. package/docs/variables/default.html +0 -1
  347. package/modules/agent.js +0 -111
  348. package/modules/browser.js +0 -331
  349. package/modules/chat.js +0 -225
  350. package/modules/codeutils.js +0 -166
  351. package/modules/crawler.js +0 -123
  352. package/modules/dbmemory.js +0 -54
  353. package/modules/debug.js +0 -64
  354. package/modules/fs.js +0 -264
  355. package/modules/git.js +0 -240
  356. package/modules/project.js +0 -72
  357. package/modules/state.js +0 -109
  358. package/modules/task.js +0 -75
  359. package/modules/tokenizer.js +0 -56
  360. package/modules/tools.js +0 -255
  361. package/modules/vectordb.js +0 -103
  362. package/script/gen.js +0 -27
  363. package/src/index.ts +0 -108
  364. package/src/modules/agent.ts +0 -120
  365. package/src/modules/agentlib/agent.ts +0 -417
  366. package/src/modules/agentlib/systemprompt.ts +0 -55
  367. package/src/modules/agentlib/taskInstruction.ts +0 -105
  368. package/src/modules/agentlib/usermessage.ts +0 -188
  369. package/src/modules/browser.ts +0 -352
  370. package/src/modules/chat.ts +0 -229
  371. package/src/modules/codeparsers.ts +0 -28
  372. package/src/modules/codeutils.ts +0 -182
  373. package/src/modules/crawler.ts +0 -121
  374. package/src/modules/dbmemory.ts +0 -52
  375. package/src/modules/debug.ts +0 -68
  376. package/src/modules/docutils.ts +0 -18
  377. package/src/modules/fs.ts +0 -263
  378. package/src/modules/git.ts +0 -237
  379. package/src/modules/history.ts +0 -82
  380. package/src/modules/knowledge.ts +0 -5
  381. package/src/modules/llm.ts +0 -36
  382. package/src/modules/outputparsers.ts +0 -30
  383. package/src/modules/project.ts +0 -68
  384. package/src/modules/rag.ts +0 -27
  385. package/src/modules/search.ts +0 -32
  386. package/src/modules/state.ts +0 -115
  387. package/src/modules/task.ts +0 -73
  388. package/src/modules/terminal.ts +0 -113
  389. package/src/modules/tokenizer.ts +0 -56
  390. package/src/modules/toolBox.ts +0 -1384
  391. package/src/modules/tools.ts +0 -254
  392. package/src/modules/vectordb.ts +0 -102
  393. package/src/modules/websocket.ts +0 -97
  394. package/src/utils/editFile.ts +0 -30
  395. package/src/utils.ts +0 -5
  396. package/tests/chat.test.js +0 -0
  397. package/tests/fs.test.js +0 -89
  398. package/tests/index.test.js +0 -4
  399. package/tsconfig.json +0 -122
  400. package/utils/editFile.js +0 -30
  401. package/utils.d.ts +0 -5
  402. package/webpack.config.js +0 -25
  403. /package/{modules → dist}/agentlib/agent.d.ts +0 -0
  404. /package/{modules → dist}/agentlib/systemprompt.d.ts +0 -0
  405. /package/{modules → dist}/agentlib/systemprompt.js +0 -0
  406. /package/{modules → dist}/agentlib/taskInstruction.d.ts +0 -0
  407. /package/{modules → dist}/agentlib/taskInstruction.js +0 -0
  408. /package/{modules → dist}/agentlib/usermessage.d.ts +0 -0
  409. /package/{modules → dist/modules}/agent.d.ts +0 -0
  410. /package/{modules → dist/modules}/codeparsers.d.ts +0 -0
  411. /package/{modules → dist/modules}/codeparsers.js +0 -0
  412. /package/{modules → dist/modules}/dbmemory.d.ts +0 -0
  413. /package/{modules → dist/modules}/debug.d.ts +0 -0
  414. /package/{modules → dist/modules}/docutils.d.ts +0 -0
  415. /package/{modules → dist/modules}/docutils.js +0 -0
  416. /package/{modules → dist/modules}/git.d.ts +0 -0
  417. /package/{modules → dist/modules}/history.d.ts +0 -0
  418. /package/{modules → dist/modules}/knowledge.d.ts +0 -0
  419. /package/{modules → dist/modules}/knowledge.js +0 -0
  420. /package/{modules → dist/modules}/llm.d.ts +0 -0
  421. /package/{modules → dist/modules}/outputparsers.d.ts +0 -0
  422. /package/{modules → dist/modules}/outputparsers.js +0 -0
  423. /package/{modules → dist/modules}/rag.d.ts +0 -0
  424. /package/{modules → dist/modules}/rag.js +0 -0
  425. /package/{modules → dist/modules}/search.d.ts +0 -0
  426. /package/{modules → dist/modules}/search.js +0 -0
  427. /package/{modules → dist/modules}/state.d.ts +0 -0
  428. /package/{modules → dist/modules}/task.d.ts +0 -0
  429. /package/{modules → dist/modules}/tokenizer.d.ts +0 -0
  430. /package/{utils/editFile.d.ts → dist/modules/utils.d.ts} +0 -0
  431. /package/{modules → dist/modules}/vectordb.d.ts +0 -0
  432. /package/{modules → dist/utils}/toolBox.d.ts +0 -0
  433. /package/{modules → dist/utils}/toolBox.js +0 -0
@@ -1,491 +0,0 @@
1
- <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>OutgoingMessage | @codebolt/codeboltjs</title><meta name="description" content="Documentation for @codebolt/codeboltjs"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@codebolt/codeboltjs</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@codebolt/codeboltjs</a></li><li><a href="../modules/_internal_.html">&lt;internal&gt;</a></li><li><a href="_internal_.OutgoingMessage.html">OutgoingMessage</a></li></ul><h1>Class OutgoingMessage&lt;Request&gt;</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>This class serves as the parent class of <a href="_internal_.ClientRequest.html" class="tsd-kind-class">ClientRequest</a> and <a href="_internal_.ServerResponse.html" class="tsd-kind-class">ServerResponse</a>. It is an abstract outgoing message from
2
- the perspective of the participants of an HTTP transaction.</p>
3
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.17</p>
4
- </div></section> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="Request" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Request</span><span class="tsd-signature-keyword"> extends </span><a href="_internal_.IncomingMessage.html" class="tsd-signature-type tsd-kind-class">IncomingMessage</a> = <a href="_internal_.IncomingMessage.html" class="tsd-signature-type tsd-kind-class">IncomingMessage</a></span></li></ul></section> <section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a class="link" href="../hierarchy.html#<internal>.OutgoingMessage">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="_internal_.Writable.html" class="tsd-signature-type tsd-kind-class">Writable</a><ul class="tsd-hierarchy"><li><span class="target">OutgoingMessage</span><ul class="tsd-hierarchy"><li><a href="_internal_.ClientRequest.html" class="tsd-signature-type tsd-kind-class">ClientRequest</a></li><li><a href="_internal_.ServerResponse.html" class="tsd-signature-type tsd-kind-class">ServerResponse</a></li></ul></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:546</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="_internal_.OutgoingMessage.html#constructor" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
5
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_internal_.OutgoingMessage.html#chunkedEncoding" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>chunked<wbr/>Encoding</span></a>
6
- <a href="_internal_.OutgoingMessage.html#closed" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>closed</span></a>
7
- <a href="_internal_.OutgoingMessage.html#connection" class="tsd-index-link deprecated tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>connection</span></a>
8
- <a href="_internal_.OutgoingMessage.html#destroyed" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>destroyed</span></a>
9
- <a href="_internal_.OutgoingMessage.html#errored" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>errored</span></a>
10
- <a href="_internal_.OutgoingMessage.html#finished" class="tsd-index-link deprecated tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>finished</span></a>
11
- <a href="_internal_.OutgoingMessage.html#headersSent" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>headers<wbr/>Sent</span></a>
12
- <a href="_internal_.OutgoingMessage.html#req" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>req</span></a>
13
- <a href="_internal_.OutgoingMessage.html#sendDate" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>send<wbr/>Date</span></a>
14
- <a href="_internal_.OutgoingMessage.html#shouldKeepAlive" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>should<wbr/>Keep<wbr/>Alive</span></a>
15
- <a href="_internal_.OutgoingMessage.html#socket" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>socket</span></a>
16
- <a href="_internal_.OutgoingMessage.html#useChunkedEncodingByDefault" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Chunked<wbr/>Encoding<wbr/>By<wbr/>Default</span></a>
17
- <a href="_internal_.OutgoingMessage.html#writable" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable</span></a>
18
- <a href="_internal_.OutgoingMessage.html#writableCorked" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Corked</span></a>
19
- <a href="_internal_.OutgoingMessage.html#writableEnded" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Ended</span></a>
20
- <a href="_internal_.OutgoingMessage.html#writableFinished" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Finished</span></a>
21
- <a href="_internal_.OutgoingMessage.html#writableHighWaterMark" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>High<wbr/>Water<wbr/>Mark</span></a>
22
- <a href="_internal_.OutgoingMessage.html#writableLength" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Length</span></a>
23
- <a href="_internal_.OutgoingMessage.html#writableNeedDrain" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Need<wbr/>Drain</span></a>
24
- <a href="_internal_.OutgoingMessage.html#writableObjectMode" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Object<wbr/>Mode</span></a>
25
- <a href="_internal_.OutgoingMessage.html#captureRejectionSymbol" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>capture<wbr/>Rejection<wbr/>Symbol</span></a>
26
- <a href="_internal_.OutgoingMessage.html#captureRejections" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>capture<wbr/>Rejections</span></a>
27
- <a href="_internal_.OutgoingMessage.html#defaultMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>default<wbr/>Max<wbr/>Listeners</span></a>
28
- <a href="_internal_.OutgoingMessage.html#errorMonitor" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>error<wbr/>Monitor</span></a>
29
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="_internal_.OutgoingMessage.html#_captureRejectionSymbol_" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>[capture<wbr/>Rejection<wbr/>Symbol]?</span></a>
30
- <a href="_internal_.OutgoingMessage.html#_construct" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_construct?</span></a>
31
- <a href="_internal_.OutgoingMessage.html#_destroy" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_destroy</span></a>
32
- <a href="_internal_.OutgoingMessage.html#_final" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_final</span></a>
33
- <a href="_internal_.OutgoingMessage.html#_write" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_write</span></a>
34
- <a href="_internal_.OutgoingMessage.html#_writev" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_writev?</span></a>
35
- <a href="_internal_.OutgoingMessage.html#addListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Listener</span></a>
36
- <a href="_internal_.OutgoingMessage.html#addTrailers" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Trailers</span></a>
37
- <a href="_internal_.OutgoingMessage.html#appendHeader" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>append<wbr/>Header</span></a>
38
- <a href="_internal_.OutgoingMessage.html#compose" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>compose</span></a>
39
- <a href="_internal_.OutgoingMessage.html#cork" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>cork</span></a>
40
- <a href="_internal_.OutgoingMessage.html#destroy" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a>
41
- <a href="_internal_.OutgoingMessage.html#emit" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>emit</span></a>
42
- <a href="_internal_.OutgoingMessage.html#end" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>end</span></a>
43
- <a href="_internal_.OutgoingMessage.html#eventNames" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>event<wbr/>Names</span></a>
44
- <a href="_internal_.OutgoingMessage.html#flushHeaders" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>flush<wbr/>Headers</span></a>
45
- <a href="_internal_.OutgoingMessage.html#getHeader" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Header</span></a>
46
- <a href="_internal_.OutgoingMessage.html#getHeaderNames" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Header<wbr/>Names</span></a>
47
- <a href="_internal_.OutgoingMessage.html#getHeaders" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Headers</span></a>
48
- <a href="_internal_.OutgoingMessage.html#getMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a>
49
- <a href="_internal_.OutgoingMessage.html#hasHeader" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Header</span></a>
50
- <a href="_internal_.OutgoingMessage.html#listenerCount" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listener<wbr/>Count</span></a>
51
- <a href="_internal_.OutgoingMessage.html#listeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listeners</span></a>
52
- <a href="_internal_.OutgoingMessage.html#off" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>off</span></a>
53
- <a href="_internal_.OutgoingMessage.html#on" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on</span></a>
54
- <a href="_internal_.OutgoingMessage.html#once" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>once</span></a>
55
- <a href="_internal_.OutgoingMessage.html#pipe" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pipe</span></a>
56
- <a href="_internal_.OutgoingMessage.html#prependListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a>
57
- <a href="_internal_.OutgoingMessage.html#prependOnceListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a>
58
- <a href="_internal_.OutgoingMessage.html#rawListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a>
59
- <a href="_internal_.OutgoingMessage.html#removeAllListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a>
60
- <a href="_internal_.OutgoingMessage.html#removeHeader" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Header</span></a>
61
- <a href="_internal_.OutgoingMessage.html#removeListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a>
62
- <a href="_internal_.OutgoingMessage.html#setDefaultEncoding" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Default<wbr/>Encoding</span></a>
63
- <a href="_internal_.OutgoingMessage.html#setHeader" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Header</span></a>
64
- <a href="_internal_.OutgoingMessage.html#setMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
65
- <a href="_internal_.OutgoingMessage.html#setTimeout" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Timeout</span></a>
66
- <a href="_internal_.OutgoingMessage.html#uncork" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>uncork</span></a>
67
- <a href="_internal_.OutgoingMessage.html#write" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write</span></a>
68
- <a href="_internal_.OutgoingMessage.html#addAbortListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Abort<wbr/>Listener</span></a>
69
- <a href="_internal_.OutgoingMessage.html#fromWeb" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>from<wbr/>Web</span></a>
70
- <a href="_internal_.OutgoingMessage.html#getEventListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a>
71
- <a href="_internal_.OutgoingMessage.html#getMaxListeners-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a>
72
- <a href="_internal_.OutgoingMessage.html#listenerCount-2" class="tsd-index-link deprecated tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listener<wbr/>Count</span></a>
73
- <a href="_internal_.OutgoingMessage.html#on-8" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on</span></a>
74
- <a href="_internal_.OutgoingMessage.html#once-8" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>once</span></a>
75
- <a href="_internal_.OutgoingMessage.html#setMaxListeners-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
76
- <a href="_internal_.OutgoingMessage.html#toWeb" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Web</span></a>
77
- </div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_OutgoingMessage" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Outgoing<wbr/>Message</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#constructor.new_OutgoingMessage.Request-1">Request</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.OutgoingMessage.html" class="tsd-signature-type tsd-kind-class">OutgoingMessage</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#constructor.new_OutgoingMessage.Request-1">Request</a><span class="tsd-signature-symbol">&gt;</span><a href="#constructor.new_OutgoingMessage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructor.new_OutgoingMessage.Request-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Request</span><span class="tsd-signature-keyword"> extends </span><a href="_internal_.IncomingMessage.html" class="tsd-signature-type tsd-kind-class">IncomingMessage</a> = <a href="_internal_.IncomingMessage.html" class="tsd-signature-type tsd-kind-class">IncomingMessage</a></span></li></ul></section><h4 class="tsd-returns-title">Returns <a href="_internal_.OutgoingMessage.html" class="tsd-signature-type tsd-kind-class">OutgoingMessage</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#constructor.new_OutgoingMessage.Request-1">Request</a><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><p>Overrides <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#constructor">constructor</a></p><ul><li>Defined in node_modules/@types/node/http.d.ts:575</li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="chunkedEncoding" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>chunked<wbr/>Encoding</span><a href="#chunkedEncoding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">chunked<wbr/>Encoding</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:548</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="closed" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>closed</span><a href="#closed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">closed</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Is <code>true</code> after <code>&#39;close&#39;</code> has been emitted.</p>
78
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v18.0.0</p>
79
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#closed">closed</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:712</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="connection" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span class="deprecated">connection</span><a href="#connection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">connection</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.Socket.html" class="tsd-signature-type tsd-kind-class">Socket</a></div><div class="tsd-comment tsd-typography"><p>Alias of <code>outgoingMessage.socket</code>.</p>
80
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.3.0</p>
81
- <h4>Deprecated</h4><p>Since v15.12.0,v14.17.1 - Use <code>socket</code> instead.</p>
82
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:566</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="destroyed" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>destroyed</span><a href="#destroyed" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">destroyed</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Is <code>true</code> after <code>writable.destroy()</code> has been called.</p>
83
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v8.0.0</p>
84
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#destroyed">destroyed</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:707</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="errored" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>errored</span><a href="#errored" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">errored</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></div><div class="tsd-comment tsd-typography"><p>Returns error if the stream has been destroyed with an error.</p>
85
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v18.0.0</p>
86
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#errored">errored</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:717</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="finished" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="deprecated">finished</span><a href="#finished" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">finished</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><h4>Deprecated</h4><p>Use <code>writableEnded</code> instead.</p>
87
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:555</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="headersSent" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>headers<wbr/>Sent</span><a href="#headersSent" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">headers<wbr/>Sent</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Read-only. <code>true</code> if the headers were sent, otherwise <code>false</code>.</p>
88
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.9.3</p>
89
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:560</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="req" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>req</span><a href="#req" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">req</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#constructor.new_OutgoingMessage.Request-1">Request</a></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:547</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="sendDate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>send<wbr/>Date</span><a href="#sendDate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">send<wbr/>Date</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:551</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="shouldKeepAlive" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>should<wbr/>Keep<wbr/>Alive</span><a href="#shouldKeepAlive" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">should<wbr/>Keep<wbr/>Alive</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:549</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="socket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>socket</span><a href="#socket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">socket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.Socket.html" class="tsd-signature-type tsd-kind-class">Socket</a></div><div class="tsd-comment tsd-typography"><p>Reference to the underlying socket. Usually, users will not want to access
90
- this property.</p>
91
- <p>After calling <code>outgoingMessage.end()</code>, this property will be nulled.</p>
92
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.3.0</p>
93
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:574</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="useChunkedEncodingByDefault" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Chunked<wbr/>Encoding<wbr/>By<wbr/>Default</span><a href="#useChunkedEncodingByDefault" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">use<wbr/>Chunked<wbr/>Encoding<wbr/>By<wbr/>Default</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:550</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writable" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable</span><a href="#writable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Is <code>true</code> if it is safe to call <code>writable.write()</code>, which means
94
- the stream has not been destroyed, errored, or ended.</p>
95
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v11.4.0</p>
96
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writable">writable</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:668</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableCorked" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>Corked</span><a href="#writableCorked" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>Corked</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Number of times <code>writable.uncork()</code> needs to be
97
- called in order to fully uncork the stream.</p>
98
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v13.2.0, v12.16.0</p>
99
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableCorked">writableCorked</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:702</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableEnded" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>Ended</span><a href="#writableEnded" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>Ended</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Is <code>true</code> after <code>writable.end()</code> has been called. This property
100
- does not indicate whether the data has been flushed, for this use <code>writable.writableFinished</code> instead.</p>
101
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v12.9.0</p>
102
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableEnded">writableEnded</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:674</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableFinished" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>Finished</span><a href="#writableFinished" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>Finished</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Is set to <code>true</code> immediately before the <code>&#39;finish&#39;</code> event is emitted.</p>
103
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v12.6.0</p>
104
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableFinished">writableFinished</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:679</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableHighWaterMark" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>High<wbr/>Water<wbr/>Mark</span><a href="#writableHighWaterMark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>High<wbr/>Water<wbr/>Mark</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Return the value of <code>highWaterMark</code> passed when creating this <code>Writable</code>.</p>
105
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v9.3.0</p>
106
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableHighWaterMark">writableHighWaterMark</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:684</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableLength" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>Length</span><a href="#writableLength" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>Length</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>This property contains the number of bytes (or objects) in the queue
107
- ready to be written. The value provides introspection data regarding
108
- the status of the <code>highWaterMark</code>.</p>
109
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v9.4.0</p>
110
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableLength">writableLength</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:691</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableNeedDrain" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>Need<wbr/>Drain</span><a href="#writableNeedDrain" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>Need<wbr/>Drain</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Is <code>true</code> if the stream&#39;s buffer has been full and stream will emit <code>&#39;drain&#39;</code>.</p>
111
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v15.2.0, v14.17.0</p>
112
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableNeedDrain">writableNeedDrain</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:722</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="writableObjectMode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>writable<wbr/>Object<wbr/>Mode</span><a href="#writableObjectMode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writable<wbr/>Object<wbr/>Mode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Getter for the property <code>objectMode</code> of a given <code>Writable</code> stream.</p>
113
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v12.3.0</p>
114
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#writableObjectMode">writableObjectMode</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:696</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejectionSymbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>capture<wbr/>Rejection<wbr/>Symbol</span><a href="#captureRejectionSymbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejection<wbr/>Symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof </span><a href="_internal_.EventEmitter-1.html#captureRejectionSymbol" class="tsd-signature-type tsd-kind-property">captureRejectionSymbol</a></div><div class="tsd-comment tsd-typography"><p>Value: <code>Symbol.for(&#39;nodejs.rejection&#39;)</code></p>
115
- <p>See how to write a custom <code>rejection handler</code>.</p>
116
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v13.4.0, v12.16.0</p>
117
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#captureRejectionSymbol">captureRejectionSymbol</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:430</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejections" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>capture<wbr/>Rejections</span><a href="#captureRejections" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejections</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Value: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type">boolean</a></p>
118
- <p>Change the default <code>captureRejections</code> option on all new <code>EventEmitter</code> objects.</p>
119
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v13.4.0, v12.16.0</p>
120
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#captureRejections">captureRejections</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:437</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="defaultMaxListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>default<wbr/>Max<wbr/>Listeners</span><a href="#defaultMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>By default, a maximum of <code>10</code> listeners can be registered for any single
121
- event. This limit can be changed for individual <code>EventEmitter</code> instances
122
- using the <code>emitter.setMaxListeners(n)</code> method. To change the default
123
- for <em>all</em><code>EventEmitter</code> instances, the <code>events.defaultMaxListeners</code> property
124
- can be used. If this value is not a positive number, a <code>RangeError</code> is thrown.</p>
125
- <p>Take caution when setting the <code>events.defaultMaxListeners</code> because the
126
- change affects <em>all</em> <code>EventEmitter</code> instances, including those created before
127
- the change is made. However, calling <code>emitter.setMaxListeners(n)</code> still has
128
- precedence over <code>events.defaultMaxListeners</code>.</p>
129
- <p>This is not a hard limit. The <code>EventEmitter</code> instance will allow
130
- more listeners to be added but will output a trace warning to stderr indicating
131
- that a &quot;possible EventEmitter memory leak&quot; has been detected. For any single
132
- <code>EventEmitter</code>, the <code>emitter.getMaxListeners()</code> and <code>emitter.setMaxListeners()</code> methods can be used to
133
- temporarily avoid this warning:</p>
134
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">emitter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">setMaxListeners</span><span class="hl-1">(</span><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">getMaxListeners</span><span class="hl-1">() + </span><span class="hl-9">1</span><span class="hl-1">);</span><br/><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">// do stuff</span><br/><span class="hl-1"> </span><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">setMaxListeners</span><span class="hl-1">(</span><span class="hl-7">Math</span><span class="hl-1">.</span><span class="hl-0">max</span><span class="hl-1">(</span><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">getMaxListeners</span><span class="hl-1">() - </span><span class="hl-9">1</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">));</span><br/><span class="hl-1">});</span>
135
- </code><button>Copy</button></pre>
136
- <p>The <code>--trace-warnings</code> command-line flag can be used to display the
137
- stack trace for such warnings.</p>
138
- <p>The emitted warning can be inspected with <code>process.on(&#39;warning&#39;)</code> and will
139
- have the additional <code>emitter</code>, <code>type</code>, and <code>count</code> properties, referring to
140
- the event emitter instance, the event&#39;s name and the number of attached
141
- listeners, respectively.
142
- Its <code>name</code> property is set to <code>&#39;MaxListenersExceededWarning&#39;</code>.</p>
143
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.11.2</p>
144
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#defaultMaxListeners">defaultMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:476</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="errorMonitor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>error<wbr/>Monitor</span><a href="#errorMonitor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">error<wbr/>Monitor</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof </span><a href="_internal_.EventEmitter-1.html#errorMonitor" class="tsd-signature-type tsd-kind-property">errorMonitor</a></div><div class="tsd-comment tsd-typography"><p>This symbol shall be used to install a listener for only monitoring <code>&#39;error&#39;</code> events. Listeners installed using this symbol are called before the regular <code>&#39;error&#39;</code> listeners are called.</p>
145
- <p>Installing a listener using this symbol does not change the behavior once an <code>&#39;error&#39;</code> event is emitted. Therefore, the process will still crash if no
146
- regular <code>&#39;error&#39;</code> listener is installed.</p>
147
- </div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v13.6.0, v12.17.0</p>
148
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#errorMonitor">errorMonitor</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:423</li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_captureRejectionSymbol_" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>[capture<wbr/>Rejection<wbr/>Symbol]</span><a href="#_captureRejectionSymbol_" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_captureRejectionSymbol_._captureRejectionSymbol_-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">[capture<wbr/>Rejection<wbr/>Symbol]</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#_captureRejectionSymbol_._captureRejectionSymbol_-1.K">K</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span>, <span class="tsd-kind-parameter">event</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#_captureRejectionSymbol_._captureRejectionSymbol_-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="_captureRejectionSymbol_._captureRejectionSymbol_-1.K" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">error</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <a href="../types/_internal_.AnyRest.html" class="tsd-signature-type tsd-kind-type-alias">AnyRest</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#_captureRejectionSymbol_">[captureRejectionSymbol]</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:135</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_construct" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>_construct</span><a href="#_construct" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_construct._construct-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_construct</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#_construct._construct-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#_construct">_construct</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:732</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_destroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_destroy</span><a href="#_destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_destroy._destroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_destroy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span>, <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#_destroy._destroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li><li><span><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#_destroy">_destroy</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:733</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_final" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_final</span><a href="#_final" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_final._final-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_final</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#_final._final-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#_final">_final</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:734</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_write" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_write</span><a href="#_write" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_write._write-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_write</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">chunk</span>, <span class="tsd-kind-parameter">encoding</span>, <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#_write._write-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">chunk</span>: <span class="tsd-signature-type">any</span></span></li><li><span><span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span></li><li><span><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#_write">_write</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:724</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_writev" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>_writev</span><a href="#_writev" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_writev._writev-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_writev</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">chunks</span>, <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#_writev._writev-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">chunks</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">chunk</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">encoding</span><span class="tsd-signature-symbol">: </span><a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span></span></li><li><span><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#_writev">_writev</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:725</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>add<wbr/>Listener</span><a href="#addListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Event emitter
149
- The defined events on documents including:</p>
150
- <ol>
151
- <li>close</li>
152
- <li>drain</li>
153
- <li>error</li>
154
- <li>finish</li>
155
- <li>pipe</li>
156
- <li>unpipe</li>
157
- </ol>
158
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:900</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:901</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:902</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:903</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:904</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:905</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#addListener.addListener-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addListener">addListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:906</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="addTrailers" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>add<wbr/>Trailers</span><a href="#addTrailers" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="addTrailers.addTrailers-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Trailers</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">headers</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#addTrailers.addTrailers-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds HTTP trailers (headers but at the end of the message) to the message.</p>
159
- <p>Trailers will <strong>only</strong> be emitted if the message is chunked encoded. If not,
160
- the trailers will be silently discarded.</p>
161
- <p>HTTP requires the <code>Trailer</code> header to be sent to emit trailers,
162
- with a list of header field names in its value, e.g.</p>
163
- <pre><code class="language-js"><span class="hl-7">message</span><span class="hl-1">.</span><span class="hl-0">writeHead</span><span class="hl-1">(</span><span class="hl-9">200</span><span class="hl-1">, { </span><span class="hl-2">&#39;Content-Type&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;text/plain&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&#39;Trailer&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;Content-MD5&#39;</span><span class="hl-1"> });</span><br/><span class="hl-7">message</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-7">fileData</span><span class="hl-1">);</span><br/><span class="hl-7">message</span><span class="hl-1">.</span><span class="hl-0">addTrailers</span><span class="hl-1">({ </span><span class="hl-2">&#39;Content-MD5&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;7895bf4b8828b55ceaf47747b4bca667&#39;</span><span class="hl-1"> });</span><br/><span class="hl-7">message</span><span class="hl-1">.</span><span class="hl-0">end</span><span class="hl-1">();</span>
164
- </code><button>Copy</button></pre>
165
- <p>Attempting to set a header field name or value that contains invalid characters
166
- will result in a <code>TypeError</code> being thrown.</p>
167
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">headers</span>: <a href="../interfaces/_internal_.OutgoingHttpHeaders.html" class="tsd-signature-type tsd-kind-interface">OutgoingHttpHeaders</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.3.0</p>
168
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:683</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="appendHeader" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>append<wbr/>Header</span><a href="#appendHeader" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="appendHeader.appendHeader-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">append<wbr/>Header</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span>, <span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#appendHeader.appendHeader-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Append a single header value to the header object.</p>
169
- <p>If the value is an array, this is equivalent to calling this method multiple
170
- times.</p>
171
- <p>If there were no previous values for the header, this is equivalent to calling <code>outgoingMessage.setHeader(name, value)</code>.</p>
172
- <p>Depending of the value of <code>options.uniqueHeaders</code> when the client request or the
173
- server were created, this will end up in the header being sent multiple times or
174
- a single time with values joined using <code>; </code>.</p>
175
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Header name</p>
176
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">value</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Header value</p>
177
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v18.3.0, v16.17.0</p>
178
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:606</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="compose" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>compose</span><a href="#compose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="compose.compose-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">compose</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#compose.compose-1.T">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">stream</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#compose.compose-1.T">T</a><a href="#compose.compose-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="compose.compose-1.T" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><a href="../interfaces/_internal_.ReadableStream-1.html" class="tsd-signature-type tsd-kind-interface">ReadableStream</a></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">stream</span>: <a href="../types/_internal_.ComposeFnParam.html" class="tsd-signature-type tsd-kind-type-alias">ComposeFnParam</a><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#compose.compose-1.T">T</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Iterable.html" class="tsd-signature-type tsd-kind-interface">Iterable</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#compose.compose-1.T">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.AsyncIterable.html" class="tsd-signature-type tsd-kind-interface">AsyncIterable</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#compose.compose-1.T">T</a><span class="tsd-signature-symbol">&gt;</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">signal</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AbortSignal</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">signal</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AbortSignal</span></h5></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#compose.compose-1.T">T</a></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#compose">compose</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:36</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="cork" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>cork</span><a href="#cork" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="cork.cork-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">cork</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#cork.cork-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The <code>writable.cork()</code> method forces all written data to be buffered in memory.
179
- The buffered data will be flushed when either the <a href="_internal_.WritableBase.html#uncork" class="tsd-kind-method">uncork</a> or <a href="_internal_.WritableBase.html#end" class="tsd-kind-method">end</a> methods are called.</p>
180
- <p>The primary intent of <code>writable.cork()</code> is to accommodate a situation in which
181
- several small chunks are written to the stream in rapid succession. Instead of
182
- immediately forwarding them to the underlying destination, <code>writable.cork()</code> buffers all the chunks until <code>writable.uncork()</code> is called, which will pass them
183
- all to <code>writable._writev()</code>, if present. This prevents a head-of-line blocking
184
- situation where data is being buffered while waiting for the first small chunk
185
- to be processed. However, use of <code>writable.cork()</code> without implementing <code>writable._writev()</code> may have an adverse effect on throughput.</p>
186
- <p>See also: <code>writable.uncork()</code>, <code>writable._writev()</code>.</p>
187
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.11.2</p>
188
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#cork">cork</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:838</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="destroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>destroy</span><a href="#destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="destroy.destroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">destroy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#destroy.destroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroy the stream. Optionally emit an <code>&#39;error&#39;</code> event, and emit a <code>&#39;close&#39;</code> event (unless <code>emitClose</code> is set to <code>false</code>). After this call, the writable
189
- stream has ended and subsequent calls to <code>write()</code> or <code>end()</code> will result in
190
- an <code>ERR_STREAM_DESTROYED</code> error.
191
- This is a destructive and immediate way to destroy a stream. Previous calls to <code>write()</code> may not have drained, and may trigger an <code>ERR_STREAM_DESTROYED</code> error.
192
- Use <code>end()</code> instead of destroy if data should flush before close, or wait for
193
- the <code>&#39;drain&#39;</code> event before destroying the stream.</p>
194
- <p>Once <code>destroy()</code> has been called any further calls will be a no-op and no
195
- further errors except from <code>_destroy()</code> may be emitted as <code>&#39;error&#39;</code>.</p>
196
- <p>Implementors should not override this method,
197
- but instead implement <code>writable._destroy()</code>.</p>
198
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">error</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span><div class="tsd-comment tsd-typography"><p>Optional, an error to emit with <code>&#39;error&#39;</code> event.</p>
199
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v8.0.0</p>
200
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#destroy">destroy</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:889</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="emit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>emit</span><a href="#emit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Synchronously calls each of the listeners registered for the event named <code>eventName</code>, in the order they were registered, passing the supplied arguments
201
- to each.</p>
202
- <p>Returns <code>true</code> if the event had listeners, <code>false</code> otherwise.</p>
203
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myEmitter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-5">// First listener</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">firstListener</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Helloooo! first listener&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><span class="hl-5">// Second listener</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">secondListener</span><span class="hl-1">(</span><span class="hl-7">arg1</span><span class="hl-1">, </span><span class="hl-7">arg2</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`event with parameters </span><span class="hl-3">${</span><span class="hl-7">arg1</span><span class="hl-3">}</span><span class="hl-2">, </span><span class="hl-3">${</span><span class="hl-7">arg2</span><span class="hl-3">}</span><span class="hl-2"> in second listener`</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><span class="hl-5">// Third listener</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">thirdListener</span><span class="hl-1">(...</span><span class="hl-7">args</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">parameters</span><span class="hl-1"> = </span><span class="hl-7">args</span><span class="hl-1">.</span><span class="hl-0">join</span><span class="hl-1">(</span><span class="hl-2">&#39;, &#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`event with parameters </span><span class="hl-3">${</span><span class="hl-7">parameters</span><span class="hl-3">}</span><span class="hl-2"> in third listener`</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">listeners</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">));</span><br/><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-9">1</span><span class="hl-1">, </span><span class="hl-9">2</span><span class="hl-1">, </span><span class="hl-9">3</span><span class="hl-1">, </span><span class="hl-9">4</span><span class="hl-1">, </span><span class="hl-9">5</span><span class="hl-1">);</span><br/><br/><span class="hl-5">// Prints:</span><br/><span class="hl-5">// [</span><br/><span class="hl-5">// [Function: firstListener],</span><br/><span class="hl-5">// [Function: secondListener],</span><br/><span class="hl-5">// [Function: thirdListener]</span><br/><span class="hl-5">// ]</span><br/><span class="hl-5">// Helloooo! first listener</span><br/><span class="hl-5">// event with parameters 1, 2 in second listener</span><br/><span class="hl-5">// event with parameters 1, 2, 3, 4, 5 in third listener</span>
204
- </code><button>Copy</button></pre>
205
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.26</p>
206
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:907</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:908</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:909</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:910</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:911</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:912</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#emit">emit</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:913</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="end" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>end</span><a href="#end" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="end.end-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">end</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">cb</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#end.end-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Calling the <code>writable.end()</code> method signals that no more data will be written
207
- to the <code>Writable</code>. The optional <code>chunk</code> and <code>encoding</code> arguments allow one
208
- final additional chunk of data to be written immediately before closing the
209
- stream.</p>
210
- <p>Calling the <a href="_internal_.WritableBase.html#write" class="tsd-kind-method">write</a> method after calling <a href="_internal_.WritableBase.html#end" class="tsd-kind-method">end</a> will raise an error.</p>
211
- <pre><code class="language-js"><span class="hl-5">// Write &#39;hello, &#39; and then end with &#39;world!&#39;.</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">fs</span><span class="hl-1"> = </span><span class="hl-0">require</span><span class="hl-1">(</span><span class="hl-2">&#39;node:fs&#39;</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">file</span><span class="hl-1"> = </span><span class="hl-7">fs</span><span class="hl-1">.</span><span class="hl-0">createWriteStream</span><span class="hl-1">(</span><span class="hl-2">&#39;example.txt&#39;</span><span class="hl-1">);</span><br/><span class="hl-7">file</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-2">&#39;hello, &#39;</span><span class="hl-1">);</span><br/><span class="hl-7">file</span><span class="hl-1">.</span><span class="hl-0">end</span><span class="hl-1">(</span><span class="hl-2">&#39;world!&#39;</span><span class="hl-1">);</span><br/><span class="hl-5">// Writing more now is not allowed!</span>
212
- </code><button>Copy</button></pre>
213
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">cb</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.9.4</p>
214
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#end">end</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:821</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="end.end-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">end</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">chunk</span>, <span class="tsd-kind-parameter">cb</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#end.end-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">chunk</span>: <span class="tsd-signature-type">any</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">cb</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#end">end</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:822</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="end.end-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">end</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">chunk</span>, <span class="tsd-kind-parameter">encoding</span>, <span class="tsd-kind-parameter">cb</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#end.end-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">chunk</span>: <span class="tsd-signature-type">any</span></span></li><li><span><span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">cb</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#end">end</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:823</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="eventNames" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>event<wbr/>Names</span><a href="#eventNames" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="eventNames.eventNames-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">event<wbr/>Names</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><a href="#eventNames.eventNames-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns an array listing the events for which the emitter has registered
215
- listeners. The values in the array are strings or <code>Symbol</code>s.</p>
216
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myEE</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {});</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;bar&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {});</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">sym</span><span class="hl-1"> = </span><span class="hl-0">Symbol</span><span class="hl-1">(</span><span class="hl-2">&#39;symbol&#39;</span><span class="hl-1">);</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-7">sym</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {});</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">eventNames</span><span class="hl-1">());</span><br/><span class="hl-5">// Prints: [ &#39;foo&#39;, &#39;bar&#39;, Symbol(symbol) ]</span>
217
- </code><button>Copy</button></pre>
218
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v6.0.0</p>
219
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#eventNames">eventNames</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:900</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="flushHeaders" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>flush<wbr/>Headers</span><a href="#flushHeaders" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="flushHeaders.flushHeaders-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">flush<wbr/>Headers</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#flushHeaders.flushHeaders-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Flushes the message headers.</p>
220
- <p>For efficiency reason, Node.js normally buffers the message headers
221
- until <code>outgoingMessage.end()</code> is called or the first chunk of message data
222
- is written. It then tries to pack the headers and data into a single TCP
223
- packet.</p>
224
- <p>It is usually desired (it saves a TCP round-trip), but not when the first
225
- data is not sent until possibly much later. <code>outgoingMessage.flushHeaders()</code> bypasses the optimization and kickstarts the message.</p>
226
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v1.6.0</p>
227
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:696</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="getHeader" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Header</span><a href="#getHeader" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getHeader.getHeader-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Header</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><a href="#getHeader.getHeader-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the value of the HTTP header with the given name. If that header is not
228
- set, the returned value will be <code>undefined</code>.</p>
229
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Name of header</p>
230
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.4.0</p>
231
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:613</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="getHeaderNames" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Header<wbr/>Names</span><a href="#getHeaderNames" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getHeaderNames.getHeaderNames-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Header<wbr/>Names</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><a href="#getHeaderNames.getHeaderNames-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns an array containing the unique names of the current outgoing headers.
232
- All names are lowercase.</p>
233
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v7.7.0</p>
234
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:641</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="getHeaders" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Headers</span><a href="#getHeaders" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getHeaders.getHeaders-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Headers</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_internal_.OutgoingHttpHeaders.html" class="tsd-signature-type tsd-kind-interface">OutgoingHttpHeaders</a><a href="#getHeaders.getHeaders-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a shallow copy of the current outgoing headers. Since a shallow
235
- copy is used, array values may be mutated without additional calls to
236
- various header-related HTTP module methods. The keys of the returned
237
- object are the header names and the values are the respective header
238
- values. All header names are lowercase.</p>
239
- <p>The object returned by the <code>outgoingMessage.getHeaders()</code> method does
240
- not prototypically inherit from the JavaScript <code>Object</code>. This means that
241
- typical <code>Object</code> methods such as <code>obj.toString()</code>, <code>obj.hasOwnProperty()</code>,
242
- and others are not defined and will not work.</p>
243
- <pre><code class="language-js"><span class="hl-7">outgoingMessage</span><span class="hl-1">.</span><span class="hl-0">setHeader</span><span class="hl-1">(</span><span class="hl-2">&#39;Foo&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;bar&#39;</span><span class="hl-1">);</span><br/><span class="hl-7">outgoingMessage</span><span class="hl-1">.</span><span class="hl-0">setHeader</span><span class="hl-1">(</span><span class="hl-2">&#39;Set-Cookie&#39;</span><span class="hl-1">, [</span><span class="hl-2">&#39;foo=bar&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;bar=baz&#39;</span><span class="hl-1">]);</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">headers</span><span class="hl-1"> = </span><span class="hl-7">outgoingMessage</span><span class="hl-1">.</span><span class="hl-0">getHeaders</span><span class="hl-1">();</span><br/><span class="hl-5">// headers === { foo: &#39;bar&#39;, &#39;set-cookie&#39;: [&#39;foo=bar&#39;, &#39;bar=baz&#39;] }</span>
244
- </code><button>Copy</button></pre>
245
- </div><h4 class="tsd-returns-title">Returns <a href="../interfaces/_internal_.OutgoingHttpHeaders.html" class="tsd-signature-type tsd-kind-interface">OutgoingHttpHeaders</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v7.7.0</p>
246
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:635</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getMaxListeners.getMaxListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#getMaxListeners.getMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the current max listener value for the <code>EventEmitter</code> which is either
247
- set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="_internal_.OutgoingMessage.html#defaultMaxListeners" class="tsd-kind-property">defaultMaxListeners</a>.</p>
248
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v1.0.0</p>
249
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#getMaxListeners">getMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:752</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="hasHeader" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>has<wbr/>Header</span><a href="#hasHeader" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="hasHeader.hasHeader-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">has<wbr/>Header</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#hasHeader.hasHeader-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns <code>true</code> if the header identified by <code>name</code> is currently set in the
250
- outgoing headers. The header name is case-insensitive.</p>
251
- <pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">hasContentType</span><span class="hl-1"> = </span><span class="hl-7">outgoingMessage</span><span class="hl-1">.</span><span class="hl-0">hasHeader</span><span class="hl-1">(</span><span class="hl-2">&#39;content-type&#39;</span><span class="hl-1">);</span>
252
- </code><button>Copy</button></pre>
253
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v7.7.0</p>
254
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:651</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>listener<wbr/>Count</span><a href="#listenerCount" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="listenerCount.listenerCount-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#listenerCount.listenerCount-1.K-1">K</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#listenerCount.listenerCount-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the number of listeners listening for the event named <code>eventName</code>.
255
- If <code>listener</code> is provided, it will return how many times the listener is found
256
- in the list of the listeners of the event.</p>
257
- </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="listenerCount.listenerCount-1.K-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p>
258
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-type">Function</span></span><div class="tsd-comment tsd-typography"><p>The event handler function</p>
259
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v3.2.0</p>
260
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#listenerCount">listenerCount</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:846</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>listeners</span><a href="#listeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="listeners.listeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listeners</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#listeners.listeners-1.K-2">K</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span><a href="#listeners.listeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
261
- <pre><code class="language-js"><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, (</span><span class="hl-7">stream</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;someone connected!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">util</span><span class="hl-1">.</span><span class="hl-0">inspect</span><span class="hl-1">(</span><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">listeners</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">)));</span><br/><span class="hl-5">// Prints: [ [Function] ]</span>
262
- </code><button>Copy</button></pre>
263
- </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="listeners.listeners-1.K-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.26</p>
264
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#listeners">listeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:765</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="off" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>off</span><a href="#off" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="off.off-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">off</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#off.off-1.K-3">K</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#off.off-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.removeListener()</code>.</p>
265
- </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="off.off-1.K-3" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v10.0.0</p>
266
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#off">off</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:725</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on</span><a href="#on" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="on.on-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the end of the listeners array for the event
267
- named <code>eventName</code>. No checks are made to see if the <code>listener</code> has already
268
- been added. Multiple calls passing the same combination of <code>eventName</code> and
269
- <code>listener</code> will result in the <code>listener</code> being added, and called, multiple times.</p>
270
- <pre><code class="language-js"><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, (</span><span class="hl-7">stream</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;someone connected!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
271
- </code><button>Copy</button></pre>
272
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
273
- <p>By default, event listeners are invoked in the order they are added. The <code>emitter.prependListener()</code> method can be used as an alternative to add the
274
- event listener to the beginning of the listeners array.</p>
275
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myEE</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;a&#39;</span><span class="hl-1">));</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">prependListener</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;b&#39;</span><span class="hl-1">));</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints:</span><br/><span class="hl-5">// b</span><br/><span class="hl-5">// a</span>
276
- </code><button>Copy</button></pre>
277
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p>
278
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p>
279
- </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.101</p>
280
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:914</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on.on-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:915</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on.on-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:916</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on.on-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:917</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on.on-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:918</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on.on-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:919</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on.on-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#on.on-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on">on</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:920</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>once</span><a href="#once" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="once.once-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong> <code>listener</code> function for the event named <code>eventName</code>. The
281
- next time <code>eventName</code> is triggered, this listener is removed and then invoked.</p>
282
- <pre><code class="language-js"><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, (</span><span class="hl-7">stream</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Ah, we have our first user!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
283
- </code><button>Copy</button></pre>
284
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
285
- <p>By default, event listeners are invoked in the order they are added. The <code>emitter.prependOnceListener()</code> method can be used as an alternative to add the
286
- event listener to the beginning of the listeners array.</p>
287
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myEE</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;a&#39;</span><span class="hl-1">));</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">prependOnceListener</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;b&#39;</span><span class="hl-1">));</span><br/><span class="hl-7">myEE</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints:</span><br/><span class="hl-5">// b</span><br/><span class="hl-5">// a</span>
288
- </code><button>Copy</button></pre>
289
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p>
290
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p>
291
- </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.3.0</p>
292
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:921</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once.once-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:922</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once.once-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:923</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once.once-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:924</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once.once-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:925</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once.once-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:926</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once.once-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#once.once-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once">once</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:927</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="pipe" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>pipe</span><a href="#pipe" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="pipe.pipe-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">pipe</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#pipe.pipe-1.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">destination</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#pipe.pipe-1.T-2">T</a><a href="#pipe.pipe-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="pipe.pipe-1.T-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><a href="../interfaces/_internal_.WritableStream.html" class="tsd-signature-type tsd-kind-interface">WritableStream</a></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">destination</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#pipe.pipe-1.T-2">T</a></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">end</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">end</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.IncomingMessage.html#pipe.pipe-1.T-2">T</a></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#pipe">pipe</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:30</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>prepend<wbr/>Listener</span><a href="#prependListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the <em>beginning</em> of the listeners array for the
293
- event named <code>eventName</code>. No checks are made to see if the <code>listener</code> has
294
- already been added. Multiple calls passing the same combination of <code>eventName</code>
295
- and <code>listener</code> will result in the <code>listener</code> being added, and called, multiple times.</p>
296
- <pre><code class="language-js"><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">prependListener</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, (</span><span class="hl-7">stream</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;someone connected!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
297
- </code><button>Copy</button></pre>
298
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
299
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p>
300
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p>
301
- </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v6.0.0</p>
302
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:928</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:929</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:930</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:931</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:932</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:933</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependListener.prependListener-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependListener">prependListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:934</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependOnceListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>prepend<wbr/>Once<wbr/>Listener</span><a href="#prependOnceListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong><code>listener</code> function for the event named <code>eventName</code> to the <em>beginning</em> of the listeners array. The next time <code>eventName</code> is triggered, this
303
- listener is removed, and then invoked.</p>
304
- <pre><code class="language-js"><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">prependOnceListener</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, (</span><span class="hl-7">stream</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Ah, we have our first user!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
305
- </code><button>Copy</button></pre>
306
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
307
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p>
308
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p>
309
- </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v6.0.0</p>
310
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:935</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:936</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:937</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:938</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:939</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:940</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#prependOnceListener.prependOnceListener-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#prependOnceListener">prependOnceListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:941</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="rawListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>raw<wbr/>Listeners</span><a href="#rawListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="rawListeners.rawListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">raw<wbr/>Listeners</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_internal_.OutgoingMessage.html#rawListeners.rawListeners-1.K-4">K</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span><a href="#rawListeners.rawListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>,
311
- including any wrappers (such as those created by <code>.once()</code>).</p>
312
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">emitter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-2">&#39;log&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;log once&#39;</span><span class="hl-1">));</span><br/><br/><span class="hl-5">// Returns a new Array with a function `onceWrapper` which has a property</span><br/><span class="hl-5">// `listener` which contains the original listener bound above</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">listeners</span><span class="hl-1"> = </span><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">rawListeners</span><span class="hl-1">(</span><span class="hl-2">&#39;log&#39;</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">logFnWrapper</span><span class="hl-1"> = </span><span class="hl-7">listeners</span><span class="hl-1">[</span><span class="hl-9">0</span><span class="hl-1">];</span><br/><br/><span class="hl-5">// Logs &quot;log once&quot; to the console and does not unbind the `once` event</span><br/><span class="hl-7">logFnWrapper</span><span class="hl-1">.</span><span class="hl-0">listener</span><span class="hl-1">();</span><br/><br/><span class="hl-5">// Logs &quot;log once&quot; to the console and removes the listener</span><br/><span class="hl-0">logFnWrapper</span><span class="hl-1">();</span><br/><br/><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;log&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;log persistently&#39;</span><span class="hl-1">));</span><br/><span class="hl-5">// Will return a new Array with a single function bound by `.on()` above</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">newListeners</span><span class="hl-1"> = </span><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">rawListeners</span><span class="hl-1">(</span><span class="hl-2">&#39;log&#39;</span><span class="hl-1">);</span><br/><br/><span class="hl-5">// Logs &quot;log persistently&quot; twice</span><br/><span class="hl-7">newListeners</span><span class="hl-1">[</span><span class="hl-9">0</span><span class="hl-1">]();</span><br/><span class="hl-7">emitter</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;log&#39;</span><span class="hl-1">);</span>
313
- </code><button>Copy</button></pre>
314
- </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="rawListeners.rawListeners-1.K-4" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v9.4.0</p>
315
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#rawListeners">rawListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:796</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeAllListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>All<wbr/>Listeners</span><a href="#removeAllListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="removeAllListeners.removeAllListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>All<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeAllListeners.removeAllListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes all listeners, or those of the specified <code>eventName</code>.</p>
316
- <p>It is bad practice to remove listeners added elsewhere in the code,
317
- particularly when the <code>EventEmitter</code> instance was created by some other
318
- component or module (e.g. sockets or file streams).</p>
319
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
320
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.26</p>
321
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeAllListeners">removeAllListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:736</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="removeHeader" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Header</span><a href="#removeHeader" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="removeHeader.removeHeader-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Header</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#removeHeader.removeHeader-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes a header that is queued for implicit sending.</p>
322
- <pre><code class="language-js"><span class="hl-7">outgoingMessage</span><span class="hl-1">.</span><span class="hl-0">removeHeader</span><span class="hl-1">(</span><span class="hl-2">&#39;Content-Encoding&#39;</span><span class="hl-1">);</span>
323
- </code><button>Copy</button></pre>
324
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Header name</p>
325
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.4.0</p>
326
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:661</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Listener</span><a href="#removeListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes the specified <code>listener</code> from the listener array for the event named <code>eventName</code>.</p>
327
- <pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-0">callback</span><span class="hl-1"> = (</span><span class="hl-7">stream</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;someone connected!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">};</span><br/><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, </span><span class="hl-7">callback</span><span class="hl-1">);</span><br/><span class="hl-5">// ...</span><br/><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-0">removeListener</span><span class="hl-1">(</span><span class="hl-2">&#39;connection&#39;</span><span class="hl-1">, </span><span class="hl-7">callback</span><span class="hl-1">);</span>
328
- </code><button>Copy</button></pre>
329
- <p><code>removeListener()</code> will remove, at most, one instance of a listener from the
330
- listener array. If any single listener has been added multiple times to the
331
- listener array for the specified <code>eventName</code>, then <code>removeListener()</code> must be
332
- called multiple times to remove each instance.</p>
333
- <p>Once an event is emitted, all listeners attached to it at the
334
- time of emitting are called in order. This implies that any <code>removeListener()</code> or <code>removeAllListeners()</code> calls <em>after</em> emitting and <em>before</em> the last listener finishes execution
335
- will not remove them from<code>emit()</code> in progress. Subsequent events behave as expected.</p>
336
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">class</span><span class="hl-1"> </span><span class="hl-8">MyEmitter</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-8">EventEmitter</span><span class="hl-1"> {}</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myEmitter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">MyEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-0">callbackA</span><span class="hl-1"> = () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;A&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">removeListener</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-7">callbackB</span><span class="hl-1">);</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-0">callbackB</span><span class="hl-1"> = () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;B&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-7">callbackA</span><span class="hl-1">);</span><br/><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, </span><span class="hl-7">callbackB</span><span class="hl-1">);</span><br/><br/><span class="hl-5">// callbackA removes listener callbackB but it will still be called.</span><br/><span class="hl-5">// Internal listener array at time of emit [callbackA, callbackB]</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints:</span><br/><span class="hl-5">// A</span><br/><span class="hl-5">// B</span><br/><br/><span class="hl-5">// callbackB is now removed.</span><br/><span class="hl-5">// Internal listener array [callbackA]</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints:</span><br/><span class="hl-5">// A</span>
337
- </code><button>Copy</button></pre>
338
- <p>Because listeners are managed using an internal array, calling this will
339
- change the position indices of any listener registered <em>after</em> the listener
340
- being removed. This will not impact the order in which listeners are called,
341
- but it means that any copies of the listener array as returned by
342
- the <code>emitter.listeners()</code> method will need to be recreated.</p>
343
- <p>When a single function has been added as a handler multiple times for a single
344
- event (as in the example below), <code>removeListener()</code> will remove the most
345
- recently added instance. In the example the <code>once(&#39;ping&#39;)</code> listener is removed:</p>
346
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">pong</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;pong&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;ping&#39;</span><span class="hl-1">, </span><span class="hl-7">pong</span><span class="hl-1">);</span><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-2">&#39;ping&#39;</span><span class="hl-1">, </span><span class="hl-7">pong</span><span class="hl-1">);</span><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">removeListener</span><span class="hl-1">(</span><span class="hl-2">&#39;ping&#39;</span><span class="hl-1">, </span><span class="hl-7">pong</span><span class="hl-1">);</span><br/><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;ping&#39;</span><span class="hl-1">);</span><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;ping&#39;</span><span class="hl-1">);</span>
347
- </code><button>Copy</button></pre>
348
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
349
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;close&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.1.26</p>
350
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:942</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;drain&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:943</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;error&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:944</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-4" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;finish&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:945</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-5" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;pipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:946</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-6" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">&quot;unpipe&quot;</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">src</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">src</span>: <a href="_internal_.Readable.html" class="tsd-signature-type tsd-kind-class">Readable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:947</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-7" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeListener.removeListener-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#removeListener">removeListener</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:948</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setDefaultEncoding" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Default<wbr/>Encoding</span><a href="#setDefaultEncoding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="setDefaultEncoding.setDefaultEncoding-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Default<wbr/>Encoding</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">encoding</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#setDefaultEncoding.setDefaultEncoding-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The <code>writable.setDefaultEncoding()</code> method sets the default <code>encoding</code> for a <code>Writable</code> stream.</p>
351
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span><div class="tsd-comment tsd-typography"><p>The new default encoding</p>
352
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.11.15</p>
353
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#setDefaultEncoding">setDefaultEncoding</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:798</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="setHeader" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Header</span><a href="#setHeader" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="setHeader.setHeader-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Header</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span>, <span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#setHeader.setHeader-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets a single header value. If the header already exists in the to-be-sent
354
- headers, its value will be replaced. Use an array of strings to send multiple
355
- headers with the same name.</p>
356
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Header name</p>
357
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">value</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Header value</p>
358
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.4.0</p>
359
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:590</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="setMaxListeners.setMaxListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#setMaxListeners.setMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>By default <code>EventEmitter</code>s will print a warning if more than <code>10</code> listeners are
360
- added for a particular event. This is a useful default that helps finding
361
- memory leaks. The <code>emitter.setMaxListeners()</code> method allows the limit to be
362
- modified for this specific <code>EventEmitter</code> instance. The value can be set to <code>Infinity</code> (or <code>0</code>) to indicate an unlimited number of listeners.</p>
363
- <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
364
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.3.5</p>
365
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#setMaxListeners">setMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:746</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="setTimeout" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Timeout</span><a href="#setTimeout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="setTimeout.setTimeout-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Timeout</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">msecs</span>, <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><a href="#setTimeout.setTimeout-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Once a socket is associated with the message and is connected, <code>socket.setTimeout()</code> will be called with <code>msecs</code> as the first parameter.</p>
366
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">msecs</span>: <span class="tsd-signature-type">number</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>Optional function to be called when a timeout occurs. Same as binding to the <code>timeout</code> event.</p>
367
- </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.9.12</p>
368
- </div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/http.d.ts:581</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="uncork" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>uncork</span><a href="#uncork" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="uncork.uncork-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">uncork</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#uncork.uncork-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The <code>writable.uncork()</code> method flushes all data buffered since <a href="_internal_.WritableBase.html#cork" class="tsd-kind-method">cork</a> was called.</p>
369
- <p>When using <code>writable.cork()</code> and <code>writable.uncork()</code> to manage the buffering
370
- of writes to a stream, defer calls to <code>writable.uncork()</code> using <code>process.nextTick()</code>. Doing so allows batching of all <code>writable.write()</code> calls that occur within a given Node.js event
371
- loop phase.</p>
372
- <pre><code class="language-js"><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">cork</span><span class="hl-1">();</span><br/><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-2">&#39;some &#39;</span><span class="hl-1">);</span><br/><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-2">&#39;data &#39;</span><span class="hl-1">);</span><br/><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">uncork</span><span class="hl-1">());</span>
373
- </code><button>Copy</button></pre>
374
- <p>If the <code>writable.cork()</code> method is called multiple times on a stream, the
375
- same number of calls to <code>writable.uncork()</code> must be called to flush the buffered
376
- data.</p>
377
- <pre><code class="language-js"><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">cork</span><span class="hl-1">();</span><br/><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-2">&#39;some &#39;</span><span class="hl-1">);</span><br/><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">cork</span><span class="hl-1">();</span><br/><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-2">&#39;data &#39;</span><span class="hl-1">);</span><br/><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">uncork</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-5">// The data will not be flushed until uncork() is called a second time.</span><br/><span class="hl-1"> </span><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">uncork</span><span class="hl-1">();</span><br/><span class="hl-1">});</span>
378
- </code><button>Copy</button></pre>
379
- <p>See also: <code>writable.cork()</code>.</p>
380
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.11.2</p>
381
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#uncork">uncork</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:872</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="write" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write</span><a href="#write" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="write.write-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">write</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">chunk</span>, <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#write.write-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The <code>writable.write()</code> method writes some data to the stream, and calls the
382
- supplied <code>callback</code> once the data has been fully handled. If an error
383
- occurs, the <code>callback</code> will be called with the error as its
384
- first argument. The <code>callback</code> is called asynchronously and before <code>&#39;error&#39;</code> is
385
- emitted.</p>
386
- <p>The return value is <code>true</code> if the internal buffer is less than the <code>highWaterMark</code> configured when the stream was created after admitting <code>chunk</code>.
387
- If <code>false</code> is returned, further attempts to write data to the stream should
388
- stop until the <code>&#39;drain&#39;</code> event is emitted.</p>
389
- <p>While a stream is not draining, calls to <code>write()</code> will buffer <code>chunk</code>, and
390
- return false. Once all currently buffered chunks are drained (accepted for
391
- delivery by the operating system), the <code>&#39;drain&#39;</code> event will be emitted.
392
- Once <code>write()</code> returns false, do not write more chunks
393
- until the <code>&#39;drain&#39;</code> event is emitted. While calling <code>write()</code> on a stream that
394
- is not draining is allowed, Node.js will buffer all written chunks until
395
- maximum memory usage occurs, at which point it will abort unconditionally.
396
- Even before it aborts, high memory usage will cause poor garbage collector
397
- performance and high RSS (which is not typically released back to the system,
398
- even after the memory is no longer required). Since TCP sockets may never
399
- drain if the remote peer does not read the data, writing a socket that is
400
- not draining may lead to a remotely exploitable vulnerability.</p>
401
- <p>Writing data while the stream is not draining is particularly
402
- problematic for a <code>Transform</code>, because the <code>Transform</code> streams are paused
403
- by default until they are piped or a <code>&#39;data&#39;</code> or <code>&#39;readable&#39;</code> event handler
404
- is added.</p>
405
- <p>If the data to be written can be generated or fetched on demand, it is
406
- recommended to encapsulate the logic into a <code>Readable</code> and use <a href="_internal_.WritableBase.html#pipe" class="tsd-kind-method">pipe</a>. However, if calling <code>write()</code> is preferred, it is
407
- possible to respect backpressure and avoid memory issues using the <code>&#39;drain&#39;</code> event:</p>
408
- <pre><code class="language-js"><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-7">data</span><span class="hl-1">, </span><span class="hl-7">cb</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-6">if</span><span class="hl-1"> (!</span><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-7">data</span><span class="hl-1">)) {</span><br/><span class="hl-1"> </span><span class="hl-7">stream</span><span class="hl-1">.</span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-2">&#39;drain&#39;</span><span class="hl-1">, </span><span class="hl-7">cb</span><span class="hl-1">);</span><br/><span class="hl-1"> } </span><span class="hl-6">else</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(</span><span class="hl-7">cb</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-5">// Wait for cb to be called before doing any other write.</span><br/><span class="hl-0">write</span><span class="hl-1">(</span><span class="hl-2">&#39;hello&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Write completed, do more writes now.&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
409
- </code><button>Copy</button></pre>
410
- <p>A <code>Writable</code> stream in object mode will always ignore the <code>encoding</code> argument.</p>
411
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">chunk</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>Optional data to write. For streams not operating in object mode, <code>chunk</code> must be a {string}, {Buffer},
412
- {TypedArray} or {DataView}. For object mode streams, <code>chunk</code> may be any JavaScript value other than <code>null</code>.</p>
413
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>Callback for when this chunk of data is flushed.</p>
414
- </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>false</code> if the stream wishes for the calling code to wait for the <code>&#39;drain&#39;</code> event to be emitted before continuing to write additional data; otherwise <code>true</code>.</p>
415
- <div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.9.4</p>
416
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#write">write</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:791</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="write.write-2" class="tsd-anchor"></a><span class="tsd-kind-call-signature">write</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">chunk</span>, <span class="tsd-kind-parameter">encoding</span>, <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#write.write-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">chunk</span>: <span class="tsd-signature-type">any</span></span></li><li><span><span class="tsd-kind-parameter">encoding</span>: <a href="../types/_internal_.BufferEncoding.html" class="tsd-signature-type tsd-kind-type-alias">BufferEncoding</a></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/_internal_.Error.html" class="tsd-signature-type tsd-kind-interface">Error</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#write">write</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:792</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addAbortListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>add<wbr/>Abort<wbr/>Listener</span><a href="#addAbortListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="addAbortListener.addAbortListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Abort<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signal</span>, <span class="tsd-kind-parameter">resource</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_internal_.Disposable.html" class="tsd-signature-type tsd-kind-interface">Disposable</a><a href="#addAbortListener.addAbortListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><code class="tsd-tag ts-flagExperimental">Experimental</code> <div class="tsd-comment tsd-typography"><p>Listens once to the <code>abort</code> event on the provided <code>signal</code>.</p>
417
- <p>Listening to the <code>abort</code> event on abort signals is unsafe and may
418
- lead to resource leaks since another third party with the signal can
419
- call <code>e.stopImmediatePropagation()</code>. Unfortunately Node.js cannot change
420
- this since it would violate the web standard. Additionally, the original
421
- API makes it easy to forget to remove listeners.</p>
422
- <p>This API allows safely using <code>AbortSignal</code>s in Node.js APIs by solving these
423
- two issues by listening to the event such that <code>stopImmediatePropagation</code> does
424
- not prevent the listener from running.</p>
425
- <p>Returns a disposable so that it may be unsubscribed from more easily.</p>
426
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">addAbortListener</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">example</span><span class="hl-1">(</span><span class="hl-7">signal</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-7">disposable</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">try</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">signal</span><span class="hl-1">.</span><span class="hl-0">addEventListener</span><span class="hl-1">(</span><span class="hl-2">&#39;abort&#39;</span><span class="hl-1">, (</span><span class="hl-7">e</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">e</span><span class="hl-1">.</span><span class="hl-0">stopImmediatePropagation</span><span class="hl-1">());</span><br/><span class="hl-1"> </span><span class="hl-7">disposable</span><span class="hl-1"> = </span><span class="hl-0">addAbortListener</span><span class="hl-1">(</span><span class="hl-7">signal</span><span class="hl-1">, (</span><span class="hl-7">e</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">// Do something when signal is aborted.</span><br/><span class="hl-1"> });</span><br/><span class="hl-1"> } </span><span class="hl-6">finally</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">disposable</span><span class="hl-1">?.[</span><span class="hl-7">Symbol</span><span class="hl-1">.</span><span class="hl-7">dispose</span><span class="hl-1">]();</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
427
- </code><button>Copy</button></pre>
428
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signal</span>: <span class="tsd-signature-type">AbortSignal</span></span></li><li><span><span class="tsd-kind-parameter">resource</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">Event</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/_internal_.Disposable.html" class="tsd-signature-type tsd-kind-interface">Disposable</a></h4><p>Disposable that removes the <code>abort</code> listener.</p>
429
- <div class="tsd-comment tsd-typography"><h4>Since</h4><p>v20.5.0</p>
430
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#addAbortListener">addAbortListener</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:415</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="fromWeb" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>from<wbr/>Web</span><a href="#fromWeb" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="fromWeb.fromWeb-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">from<wbr/>Web</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">writableStream</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.Writable.html" class="tsd-signature-type tsd-kind-class">Writable</a><a href="#fromWeb.fromWeb-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><code class="tsd-tag ts-flagExperimental">Experimental</code> <div class="tsd-comment tsd-typography"><p>A utility method for creating a <code>Writable</code> from a web <code>WritableStream</code>.</p>
431
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">writableStream</span>: <a href="../interfaces/_internal_.WritableStream-1.html" class="tsd-signature-type tsd-kind-interface">WritableStream</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <a href="../types/_internal_.Pick.html" class="tsd-signature-type tsd-kind-type-alias">Pick</a><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/_internal_.WritableOptions.html" class="tsd-signature-type tsd-kind-interface">WritableOptions</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">&quot;signal&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;highWaterMark&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;objectMode&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;decodeStrings&quot;</span><span class="tsd-signature-symbol">&gt;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.Writable.html" class="tsd-signature-type tsd-kind-class">Writable</a></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v17.0.0</p>
432
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#fromWeb">fromWeb</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:1014</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getEventListeners" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>get<wbr/>Event<wbr/>Listeners</span><a href="#getEventListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getEventListeners.getEventListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Event<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span><a href="#getEventListeners.getEventListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
433
- <p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.listeners</code> on
434
- the emitter.</p>
435
- <p>For <code>EventTarget</code>s this is the only way to get the event listeners for the
436
- event target. This is useful for debugging and diagnostic purposes.</p>
437
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">getEventListeners</span><span class="hl-1">, </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-0">listener</span><span class="hl-1"> = () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Events are fun&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-7">listener</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getEventListeners</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">)); </span><span class="hl-5">// [ [Function: listener] ]</span><br/><span class="hl-1">}</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">et</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventTarget</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-0">listener</span><span class="hl-1"> = () </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Events are fun&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">et</span><span class="hl-1">.</span><span class="hl-0">addEventListener</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-7">listener</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getEventListeners</span><span class="hl-1">(</span><span class="hl-7">et</span><span class="hl-1">, </span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">)); </span><span class="hl-5">// [ [Function: listener] ]</span><br/><span class="hl-1">}</span>
438
- </code><button>Copy</button></pre>
439
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <a href="../interfaces/_internal_.EventEmitter-2.html" class="tsd-signature-type tsd-kind-interface">EventEmitter</a><span class="tsd-signature-symbol">&lt;</span><a href="../types/_internal_.DefaultEventMap.html" class="tsd-signature-type tsd-kind-type-alias">DefaultEventMap</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></span></li><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v15.2.0, v14.17.0</p>
440
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#getEventListeners">getEventListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:336</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners-2" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getMaxListeners-2.getMaxListeners-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#getMaxListeners-2.getMaxListeners-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the currently set max amount of listeners.</p>
441
- <p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.getMaxListeners</code> on
442
- the emitter.</p>
443
- <p>For <code>EventTarget</code>s this is the only way to get the max event listeners for the
444
- event target. If the number of event handlers on a single EventTarget exceeds
445
- the max set, the EventTarget will print a warning.</p>
446
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">getMaxListeners</span><span class="hl-1">, </span><span class="hl-7">setMaxListeners</span><span class="hl-1">, </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getMaxListeners</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">)); </span><span class="hl-5">// 10</span><br/><span class="hl-1"> </span><span class="hl-0">setMaxListeners</span><span class="hl-1">(</span><span class="hl-9">11</span><span class="hl-1">, </span><span class="hl-7">ee</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getMaxListeners</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">)); </span><span class="hl-5">// 11</span><br/><span class="hl-1">}</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">et</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventTarget</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getMaxListeners</span><span class="hl-1">(</span><span class="hl-7">et</span><span class="hl-1">)); </span><span class="hl-5">// 10</span><br/><span class="hl-1"> </span><span class="hl-0">setMaxListeners</span><span class="hl-1">(</span><span class="hl-9">11</span><span class="hl-1">, </span><span class="hl-7">et</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getMaxListeners</span><span class="hl-1">(</span><span class="hl-7">et</span><span class="hl-1">)); </span><span class="hl-5">// 11</span><br/><span class="hl-1">}</span>
447
- </code><button>Copy</button></pre>
448
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <a href="../interfaces/_internal_.EventEmitter-2.html" class="tsd-signature-type tsd-kind-interface">EventEmitter</a><span class="tsd-signature-symbol">&lt;</span><a href="../types/_internal_.DefaultEventMap.html" class="tsd-signature-type tsd-kind-type-alias">DefaultEventMap</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v19.9.0</p>
449
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#getMaxListeners-2">getMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:365</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount-2" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span class="deprecated">listener<wbr/>Count</span><a href="#listenerCount-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="listenerCount-2.listenerCount-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#listenerCount-2.listenerCount-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>A class method that returns the number of listeners for the given <code>eventName</code> registered on the given <code>emitter</code>.</p>
450
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1">, </span><span class="hl-7">listenerCount</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myEmitter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {});</span><br/><span class="hl-7">myEmitter</span><span class="hl-1">.</span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">, () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {});</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">listenerCount</span><span class="hl-1">(</span><span class="hl-7">myEmitter</span><span class="hl-1">, </span><span class="hl-2">&#39;event&#39;</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints: 2</span>
451
- </code><button>Copy</button></pre>
452
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <a href="../interfaces/_internal_.EventEmitter-2.html" class="tsd-signature-type tsd-kind-interface">EventEmitter</a><span class="tsd-signature-symbol">&lt;</span><a href="../types/_internal_.DefaultEventMap.html" class="tsd-signature-type tsd-kind-type-alias">DefaultEventMap</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The emitter to query</p>
453
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The event name</p>
454
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v0.9.12</p>
455
- <h4>Deprecated</h4><p>Since v3.2.0 - Use <code>listenerCount</code> instead.</p>
456
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#listenerCount-2">listenerCount</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:308</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on-8" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>on</span><a href="#on-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="on-8.on-9" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_internal_.AsyncIterableIterator.html" class="tsd-signature-type tsd-kind-interface">AsyncIterableIterator</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><a href="#on-8.on-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">on</span><span class="hl-1">, </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-6">import</span><span class="hl-1"> </span><span class="hl-7">process</span><span class="hl-1"> </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:process&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-5">// Emit later on</span><br/><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;bar&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-9">42</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">for</span><span class="hl-1"> </span><span class="hl-6">await</span><span class="hl-1"> (</span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">event</span><span class="hl-1"> </span><span class="hl-3">of</span><span class="hl-1"> </span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">)) {</span><br/><span class="hl-1"> </span><span class="hl-5">// The execution of this inner block is synchronous and it</span><br/><span class="hl-1"> </span><span class="hl-5">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-1"> </span><span class="hl-5">// if concurrent execution is required.</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">event</span><span class="hl-1">); </span><span class="hl-5">// prints [&#39;bar&#39;] [42]</span><br/><span class="hl-1">}</span><br/><span class="hl-5">// Unreachable here</span>
457
- </code><button>Copy</button></pre>
458
- <p>Returns an <code>AsyncIterator</code> that iterates <code>eventName</code> events. It will throw
459
- if the <code>EventEmitter</code> emits <code>&#39;error&#39;</code>. It removes all listeners when
460
- exiting the loop. The <code>value</code> returned by each iteration is an array
461
- composed of the emitted event arguments.</p>
462
- <p>An <code>AbortSignal</code> can be used to cancel waiting on events:</p>
463
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">on</span><span class="hl-1">, </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-6">import</span><span class="hl-1"> </span><span class="hl-7">process</span><span class="hl-1"> </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:process&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ac</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AbortController</span><span class="hl-1">();</span><br/><br/><span class="hl-1">(</span><span class="hl-3">async</span><span class="hl-1"> () </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-1"> </span><span class="hl-5">// Emit later on</span><br/><span class="hl-1"> </span><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;bar&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-9">42</span><span class="hl-1">);</span><br/><span class="hl-1"> });</span><br/><br/><span class="hl-1"> </span><span class="hl-6">for</span><span class="hl-1"> </span><span class="hl-6">await</span><span class="hl-1"> (</span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">event</span><span class="hl-1"> </span><span class="hl-3">of</span><span class="hl-1"> </span><span class="hl-0">on</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, { </span><span class="hl-7">signal:</span><span class="hl-1"> </span><span class="hl-7">ac</span><span class="hl-1">.</span><span class="hl-7">signal</span><span class="hl-1"> })) {</span><br/><span class="hl-1"> </span><span class="hl-5">// The execution of this inner block is synchronous and it</span><br/><span class="hl-1"> </span><span class="hl-5">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-1"> </span><span class="hl-5">// if concurrent execution is required.</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">event</span><span class="hl-1">); </span><span class="hl-5">// prints [&#39;bar&#39;] [42]</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> </span><span class="hl-5">// Unreachable here</span><br/><span class="hl-1">})();</span><br/><br/><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">ac</span><span class="hl-1">.</span><span class="hl-0">abort</span><span class="hl-1">());</span>
464
- </code><button>Copy</button></pre>
465
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <a href="../interfaces/_internal_.EventEmitter-2.html" class="tsd-signature-type tsd-kind-interface">EventEmitter</a><span class="tsd-signature-symbol">&lt;</span><a href="../types/_internal_.DefaultEventMap.html" class="tsd-signature-type tsd-kind-type-alias">DefaultEventMap</a><span class="tsd-signature-symbol">&gt;</span></span></li><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p>
466
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <a href="../interfaces/_internal_.StaticEventEmitterOptions.html" class="tsd-signature-type tsd-kind-interface">StaticEventEmitterOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/_internal_.AsyncIterableIterator.html" class="tsd-signature-type tsd-kind-interface">AsyncIterableIterator</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4><p>An <code>AsyncIterator</code> that iterates <code>eventName</code> events emitted by the <code>emitter</code></p>
467
- <div class="tsd-comment tsd-typography"><h4>Since</h4><p>v13.6.0, v12.16.0</p>
468
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on-8">on</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:281</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="on-8.on-10" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_internal_.AsyncIterableIterator.html" class="tsd-signature-type tsd-kind-interface">AsyncIterableIterator</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><a href="#on-8.on-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type">EventTarget</span></span></li><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <a href="../interfaces/_internal_.StaticEventEmitterOptions.html" class="tsd-signature-type tsd-kind-interface">StaticEventEmitterOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/_internal_.AsyncIterableIterator.html" class="tsd-signature-type tsd-kind-interface">AsyncIterableIterator</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#on-8">on</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:286</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once-8" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>once</span><a href="#once-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="once-8.once-9" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#once-8.once-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a <code>Promise</code> that is fulfilled when the <code>EventEmitter</code> emits the given
469
- event or that is rejected if the <code>EventEmitter</code> emits <code>&#39;error&#39;</code> while waiting.
470
- The <code>Promise</code> will resolve with an array of all the arguments emitted to the
471
- given event.</p>
472
- <p>This method is intentionally generic and works with the web platform <a href="https://dom.spec.whatwg.org/#interface-eventtarget">EventTarget</a> interface, which has no special<code>&#39;error&#39;</code> event
473
- semantics and does not listen to the <code>&#39;error&#39;</code> event.</p>
474
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">once</span><span class="hl-1">, </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><span class="hl-6">import</span><span class="hl-1"> </span><span class="hl-7">process</span><span class="hl-1"> </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:process&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;myevent&#39;</span><span class="hl-1">, </span><span class="hl-9">42</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> [</span><span class="hl-4">value</span><span class="hl-1">] = </span><span class="hl-6">await</span><span class="hl-1"> </span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;myevent&#39;</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">value</span><span class="hl-1">);</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">err</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Error</span><span class="hl-1">(</span><span class="hl-2">&#39;kaboom&#39;</span><span class="hl-1">);</span><br/><span class="hl-7">process</span><span class="hl-1">.</span><span class="hl-0">nextTick</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;error&#39;</span><span class="hl-1">, </span><span class="hl-7">err</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">try</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">await</span><span class="hl-1"> </span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;myevent&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">} </span><span class="hl-6">catch</span><span class="hl-1"> (</span><span class="hl-7">err</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-2">&#39;error happened&#39;</span><span class="hl-1">, </span><span class="hl-7">err</span><span class="hl-1">);</span><br/><span class="hl-1">}</span>
475
- </code><button>Copy</button></pre>
476
- <p>The special handling of the <code>&#39;error&#39;</code> event is only used when <code>events.once()</code> is used to wait for another event. If <code>events.once()</code> is used to wait for the
477
- &#39;<code>error&#39;</code> event itself, then it is treated as any other kind of event without
478
- special handling:</p>
479
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1">, </span><span class="hl-7">once</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;error&#39;</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">then</span><span class="hl-1">(([</span><span class="hl-7">err</span><span class="hl-1">]) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;ok&#39;</span><span class="hl-1">, </span><span class="hl-7">err</span><span class="hl-1">.</span><span class="hl-7">message</span><span class="hl-1">))</span><br/><span class="hl-1"> .</span><span class="hl-0">catch</span><span class="hl-1">((</span><span class="hl-7">err</span><span class="hl-1">) </span><span class="hl-3">=&gt;</span><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-2">&#39;error&#39;</span><span class="hl-1">, </span><span class="hl-7">err</span><span class="hl-1">.</span><span class="hl-7">message</span><span class="hl-1">));</span><br/><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;error&#39;</span><span class="hl-1">, </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Error</span><span class="hl-1">(</span><span class="hl-2">&#39;boom&#39;</span><span class="hl-1">));</span><br/><br/><span class="hl-5">// Prints: ok boom</span>
480
- </code><button>Copy</button></pre>
481
- <p>An <code>AbortSignal</code> can be used to cancel waiting for the event:</p>
482
- <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">EventEmitter</span><span class="hl-1">, </span><span class="hl-7">once</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ee</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ac</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AbortController</span><span class="hl-1">();</span><br/><br/><span class="hl-3">async</span><span class="hl-1"> </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">foo</span><span class="hl-1">(</span><span class="hl-7">emitter</span><span class="hl-1">, </span><span class="hl-7">event</span><span class="hl-1">, </span><span class="hl-7">signal</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-6">try</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">await</span><span class="hl-1"> </span><span class="hl-0">once</span><span class="hl-1">(</span><span class="hl-7">emitter</span><span class="hl-1">, </span><span class="hl-7">event</span><span class="hl-1">, { </span><span class="hl-7">signal</span><span class="hl-1"> });</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;event emitted!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> } </span><span class="hl-6">catch</span><span class="hl-1"> (</span><span class="hl-7">error</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-6">if</span><span class="hl-1"> (</span><span class="hl-7">error</span><span class="hl-1">.</span><span class="hl-7">name</span><span class="hl-1"> === </span><span class="hl-2">&#39;AbortError&#39;</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-2">&#39;Waiting for the event was canceled!&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> } </span><span class="hl-6">else</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-2">&#39;There was an error&#39;</span><span class="hl-1">, </span><span class="hl-7">error</span><span class="hl-1">.</span><span class="hl-7">message</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-0">foo</span><span class="hl-1">(</span><span class="hl-7">ee</span><span class="hl-1">, </span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">, </span><span class="hl-7">ac</span><span class="hl-1">.</span><span class="hl-7">signal</span><span class="hl-1">);</span><br/><span class="hl-7">ac</span><span class="hl-1">.</span><span class="hl-0">abort</span><span class="hl-1">(); </span><span class="hl-5">// Abort waiting for the event</span><br/><span class="hl-7">ee</span><span class="hl-1">.</span><span class="hl-0">emit</span><span class="hl-1">(</span><span class="hl-2">&#39;foo&#39;</span><span class="hl-1">); </span><span class="hl-5">// Prints: Waiting for the event was canceled!</span>
483
- </code><button>Copy</button></pre>
484
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <a href="../interfaces/_internal_.EventEmitter-2.html" class="tsd-signature-type tsd-kind-interface">EventEmitter</a><span class="tsd-signature-symbol">&lt;</span><a href="../types/_internal_.DefaultEventMap.html" class="tsd-signature-type tsd-kind-type-alias">DefaultEventMap</a><span class="tsd-signature-symbol">&gt;</span></span></li><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <a href="../types/_internal_.Pick.html" class="tsd-signature-type tsd-kind-type-alias">Pick</a><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/_internal_.StaticEventEmitterOptions.html" class="tsd-signature-type tsd-kind-interface">StaticEventEmitterOptions</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">&quot;signal&quot;</span><span class="tsd-signature-symbol">&gt;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v11.13.0, v10.16.0</p>
485
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once-8">once</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:216</li></ul></aside></li><li class="tsd-signature tsd-anchor-link"><a id="once-8.once-10" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#once-8.once-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type">EventTarget</span></span></li><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <a href="../interfaces/_internal_.StaticEventEmitterOptions.html" class="tsd-signature-type tsd-kind-interface">StaticEventEmitterOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#once-8">once</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:221</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners-2" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="setMaxListeners-2.setMaxListeners-3" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">eventTargets</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setMaxListeners-2.setMaxListeners-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-7">setMaxListeners</span><span class="hl-1">, </span><span class="hl-7">EventEmitter</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;node:events&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">target</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventTarget</span><span class="hl-1">();</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">emitter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">EventEmitter</span><span class="hl-1">();</span><br/><br/><span class="hl-0">setMaxListeners</span><span class="hl-1">(</span><span class="hl-9">5</span><span class="hl-1">, </span><span class="hl-7">target</span><span class="hl-1">, </span><span class="hl-7">emitter</span><span class="hl-1">);</span>
486
- </code><button>Copy</button></pre>
487
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>A non-negative number. The maximum number of listeners per <code>EventTarget</code> event.</p>
488
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">eventTargets</span>: <span class="tsd-signature-symbol">(</span><a href="../interfaces/_internal_.EventEmitter-2.html" class="tsd-signature-type tsd-kind-interface">EventEmitter</a><span class="tsd-signature-symbol">&lt;</span><a href="../types/_internal_.DefaultEventMap.html" class="tsd-signature-type tsd-kind-type-alias">DefaultEventMap</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v15.4.0</p>
489
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#setMaxListeners-2">setMaxListeners</a></p><ul><li>Defined in node_modules/@types/node/events.d.ts:380</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="toWeb" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>to<wbr/>Web</span><a href="#toWeb" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="toWeb.toWeb-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">to<wbr/>Web</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">streamWritable</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/_internal_.WritableStream-1.html" class="tsd-signature-type tsd-kind-interface">WritableStream</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><a href="#toWeb.toWeb-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><code class="tsd-tag ts-flagExperimental">Experimental</code> <div class="tsd-comment tsd-typography"><p>A utility method for creating a web <code>WritableStream</code> from a <code>Writable</code>.</p>
490
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">streamWritable</span>: <a href="_internal_.Writable.html" class="tsd-signature-type tsd-kind-class">Writable</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/_internal_.WritableStream-1.html" class="tsd-signature-type tsd-kind-interface">WritableStream</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v17.0.0</p>
491
- </div><aside class="tsd-sources"><p>Inherited from <a href="_internal_.Writable.html">Writable</a>.<a href="_internal_.Writable.html#toWeb">toWeb</a></p><ul><li>Defined in node_modules/@types/node/stream.d.ts:1023</li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#constructor" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a><a href="#chunkedEncoding" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>chunked<wbr/>Encoding</span></a><a href="#closed" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>closed</span></a><a href="#connection" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>connection</span></a><a href="#destroyed" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>destroyed</span></a><a href="#errored" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>errored</span></a><a href="#finished" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>finished</span></a><a href="#headersSent" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>headers<wbr/>Sent</span></a><a href="#req" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>req</span></a><a href="#sendDate" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>send<wbr/>Date</span></a><a href="#shouldKeepAlive" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>should<wbr/>Keep<wbr/>Alive</span></a><a href="#socket" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>socket</span></a><a href="#useChunkedEncodingByDefault" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Chunked<wbr/>Encoding<wbr/>By<wbr/>Default</span></a><a href="#writable" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable</span></a><a href="#writableCorked" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Corked</span></a><a href="#writableEnded" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Ended</span></a><a href="#writableFinished" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Finished</span></a><a href="#writableHighWaterMark" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>High<wbr/>Water<wbr/>Mark</span></a><a href="#writableLength" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Length</span></a><a href="#writableNeedDrain" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Need<wbr/>Drain</span></a><a href="#writableObjectMode" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>writable<wbr/>Object<wbr/>Mode</span></a><a href="#captureRejectionSymbol" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>capture<wbr/>Rejection<wbr/>Symbol</span></a><a href="#captureRejections" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>capture<wbr/>Rejections</span></a><a href="#defaultMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>default<wbr/>Max<wbr/>Listeners</span></a><a href="#errorMonitor" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>error<wbr/>Monitor</span></a><a href="#_captureRejectionSymbol_" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>[capture<wbr/>Rejection<wbr/>Symbol]</span></a><a href="#_construct" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_construct</span></a><a href="#_destroy" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_destroy</span></a><a href="#_final" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_final</span></a><a href="#_write" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_write</span></a><a href="#_writev" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_writev</span></a><a href="#addListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Listener</span></a><a href="#addTrailers" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Trailers</span></a><a href="#appendHeader" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>append<wbr/>Header</span></a><a href="#compose" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>compose</span></a><a href="#cork" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>cork</span></a><a href="#destroy" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a><a href="#emit" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>emit</span></a><a href="#end" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>end</span></a><a href="#eventNames" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>event<wbr/>Names</span></a><a href="#flushHeaders" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>flush<wbr/>Headers</span></a><a href="#getHeader" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Header</span></a><a href="#getHeaderNames" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Header<wbr/>Names</span></a><a href="#getHeaders" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Headers</span></a><a href="#getMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a><a href="#hasHeader" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Header</span></a><a href="#listenerCount" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listener<wbr/>Count</span></a><a href="#listeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listeners</span></a><a href="#off" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>off</span></a><a href="#on" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on</span></a><a href="#once" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>once</span></a><a href="#pipe" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pipe</span></a><a href="#prependListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a><a href="#prependOnceListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a><a href="#rawListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a><a href="#removeAllListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a><a href="#removeHeader" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Header</span></a><a href="#removeListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a><a href="#setDefaultEncoding" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Default<wbr/>Encoding</span></a><a href="#setHeader" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Header</span></a><a href="#setMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a><a href="#setTimeout" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Timeout</span></a><a href="#uncork" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>uncork</span></a><a href="#write" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write</span></a><a href="#addAbortListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Abort<wbr/>Listener</span></a><a href="#fromWeb" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>from<wbr/>Web</span></a><a href="#getEventListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a><a href="#getMaxListeners-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a><a href="#listenerCount-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listener<wbr/>Count</span></a><a href="#on-8" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on</span></a><a href="#once-8" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>once</span></a><a href="#setMaxListeners-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a><a href="#toWeb" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Web</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@codebolt/codeboltjs</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>