npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

node-osc

4.1.0 • Public • Published

node-osc

A very basic OSC client (so far) implementation based heavily on pyOSC.

Install using npm

npm install node-osc

Example

Sending OSC messages:

const { Client } = require('node-osc');
 
const client = new Client('127.0.0.1', 3333);
client.send('/oscAddress', 200, () => {
  client.close();
});

Listening for OSC messages:

var { Server } = require('../lib');
 
var oscServer = new Server(3333, '0.0.0.0');
 
oscServer.on('message', function (msg) {
  console.log(`Message: ${msg}`);
  oscServer.close();
});

Now with ESM!

import { Client, Server } from 'node-osc/esm.mjs'
 
const client = new Client('127.0.0.1', 3333);
var server = new Server(3333, '0.0.0.0');
 
server.on('message', function (msg) {
  console.log(`Message: ${msg}`);
  server.close();
});
 
client.send('/hello', 'world', (err) => {
  if (err) console.error(err);
  client.close();
});

License

LGPL. Please see the file lesser.txt for details.

Keywords

install

npm i node-osc

Downloadsweekly downloads

301

version

4.1.0

license

LGPL-2.1

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability