🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

node-osc

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-osc - npm Package Compare versions

Comparing version

to
5.0.0

.github/workflows/nodejs.yml

43

dist/bundle.js

@@ -266,6 +266,9 @@ 'use strict';

let message = args[0];
let callback = () => {};
let callback;
if (typeof args[args.length - 1] === 'function') {
callback = args.pop();
}
else {
callback = () => {};
}

@@ -281,18 +284,26 @@ if (message instanceof Array) {

let buf;
switch (typeof message) {
case 'object':
buf = toBuffer(message);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
case 'string':
mes = new Message(args[0]);
for (let i = 1; i < args.length; i++) {
mes.append(args[i]);
}
buf = toBuffer(mes);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
default:
throw new Error('That Message Just Doesn\'t Seem Right');
try {
switch (typeof message) {
case 'object':
buf = toBuffer(message);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
case 'string':
mes = new Message(args[0]);
for (let i = 1; i < args.length; i++) {
mes.append(args[i]);
}
buf = toBuffer(mes);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
default:
throw new TypeError('That Message Just Doesn\'t Seem Right');
}
}
catch (e) {
if (e.code !== 'ERR_SOCKET_DGRAM_NOT_RUNNING') throw e;
const error = new ReferenceError('Cannot send message on closed socket.');
error.code = e.code;
callback(error);
}
}

@@ -299,0 +310,0 @@ }

{
"name": "node-osc",
"description": "pyOSC inspired library",
"version": "5.0.0-beta.1",
"version": "5.0.0",
"main": "./dist/bundle.js",

@@ -15,3 +15,3 @@ "exports": {

"engines": {
"node": ">=12"
"node": ">=10"
},

@@ -22,4 +22,5 @@ "license": "LGPL-2.1",

"prepublishOnly": "npm run build",
"test": "npm run lint && npm run build && npm run tap",
"tap": "c8 tap --no-coverage --no-esm --node-arg=--experimental-modules test/test-*{.js,.mjs}",
"test-legacy": "npm run lint && npm run build && npm run tap -- test/test-*.js",
"test": "npm run lint && npm run build && npm run tap -- test/test-*{.js,.mjs}",
"tap": "c8 tap --no-coverage --no-esm --node-arg=--experimental-modules",
"lint": "eslint lib/* test/* examples/*"

@@ -47,5 +48,6 @@ },

"eslint": "^6.0.1",
"rollup": "^1.27.9",
"tap": "^14.6.1"
"get-port": "^5.1.1",
"tap": "^14.10.7",
"rollup": "^1.27.9"
}
}
# node-osc
A very basic OSC client (so far) implementation based heavily on [pyOSC](https://trac.v2.nl/wiki/pyOSC).
A very basic [Open Sound Control](http://opensoundcontrol.org/introduction-osc) client. Heavily inspired by [pyOSC](https://trac.v2.nl/wiki/pyOSC).

@@ -5,0 +5,0 @@ Install using npm

'use strict';
const test = require('tap').test;
const t = require('tap');
const test = t.test;
const generatePort = require('./generate-port');
const getPort = require('get-port');
const osc = require('node-osc');
const osc = require('../');
t.beforeEach(async (done, t) => {
t.context.port = await getPort({
port: getPort.makeRange(3000, 3100)
});
});
test('osc: argument message no callback', (t) => {
const port = generatePort();
const oscServer = new osc.Server(port, '0.0.0.0');
const client = new osc.Client('0.0.0.0', port);
const oscServer = new osc.Server(t.context.port, '127.0.0.1');
const client = new osc.Client('127.0.0.1', t.context.port);

@@ -26,5 +32,4 @@ t.plan(1);

test('osc: client with callback and message as arguments', (t) => {
const port = generatePort();
const oscServer = new osc.Server(port, '0.0.0.0');
const client = new osc.Client('0.0.0.0', port);
const oscServer = new osc.Server(t.context.port, '127.0.0.1');
const client = new osc.Client('127.0.0.1', t.context.port);

@@ -31,0 +36,0 @@ t.plan(2);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet