let client = dgram.createSocket('udp4');
client.on('message', function(msg, info) {
console.log(">"+JSON.stringify(msg));
console.log(">"+JSON.stringify(info));
// you probably don't care about this
});
// to send a midi note, you do:
client.send('your data', port, 'servername');
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hmm, looks like there aren't specific docs on it - I should add that. UDP is handled in the same way as is done for Node.js.
As an example: https://github.com/espruino/Espruino/blob/master/tests/test_dgram_socket.js