Object function reference

read

A reference entry for read

Object function · Socket

read() ⇒ string | undefined

Reads the next line from a TCP socket or the next queued text message from a WebSocket. Returns undefined when the remote endpoint closes the connection or when a configured timeout expires.