Skip to main content
OnReadOpts.callback - node__net.d.ts - Node documentation
method OnReadOpts.callback

Usage in Deno

```typescript import { type OnReadOpts } from "node:node__net.d.ts"; ```
OnReadOpts.callback(
bytesWritten: number,
buffer: Uint8Array,
): boolean
This function is called for every chunk of incoming data. Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`. Return `false` from this function to implicitly `pause()` the socket.

Parameters

bytesWritten: number
buffer: Uint8Array

Return Type

boolean