UDP to Readable Stream
Read data from a UDP socket into a readable stream. No dependencies.
If you encounter an issue, fork the repository, write tests demonstrating the issue, and create a pull request.
const udpToReadableStream = ;const crypto = ; const chunks = crypto crypto crypto crypto; const port = Math;const socket = dgram;const stream = ; stream; stream; stream; for const chunk of chunks socket; stream; // Destroying the stream closes the socketsocket;
Install
yarn add udp-to-readable-stream
API
Table of Contents
index
Listen to a UDP port and send data to a readable stream.
Parameters
port
number Port to be passed to socket.bindaddress
string Address to be passed to socket.bindoptions
Object Socket options dgram.createSocket (optional, default{}
)
Returns any Readable<Buffer | string>