Writable stream implementation of dgram.send
npm install udp-streams2Or:
var UdpStream = require('udp-streams2');
UdpStream.create({
host: '127.0.0.1,
port: 1234
}, function (err, client) {
client.write('hello');
});
While UDP socket creation is essentially synchronous, this module does perform DNS lookup in order to determine whether to create an IPv4 or an IPv6 instance (based on the resolved value). It also stores the resolved IP and sends directly to that, rather than performing a lookup every time. For these reasons, the API itself is asynchronous.
Clone, npm install, npm test.