mirror of
https://github.com/jwetzell/osc-js.git
synced 2026-08-21 06:49:02 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| acc93189a9 | |||
| 180c9ff76a | |||
| 25fe42415e | |||
| fd6949c897 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "readosc",
|
"name": "readosc",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"description": "Simple NodeJS utility for parsing osc buffers from stdin",
|
"description": "Simple NodeJS utility for parsing osc buffers from stdin",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jwetzell/osc": "0.2.2",
|
"@jwetzell/osc": "1.0.0",
|
||||||
"commander": "^11.0.0"
|
"commander": "^11.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,18 @@ program.description('simple util to read osc packets from stdin');
|
|||||||
program.action(() => {
|
program.action(() => {
|
||||||
process.stdin.on('data', (data) => {
|
process.stdin.on('data', (data) => {
|
||||||
try {
|
try {
|
||||||
const message = osc.messageFromBuffer(data);
|
|
||||||
console.log(JSON.stringify(message));
|
let remainingBytes = data
|
||||||
|
while(remainingBytes.length > 0){
|
||||||
|
try {
|
||||||
|
const [message, bytesAfterMessage] = osc.messageFromBuffer(remainingBytes);
|
||||||
|
remainingBytes = bytesAfterMessage
|
||||||
|
console.log(JSON.stringify(message));
|
||||||
|
} catch (error) {
|
||||||
|
console.error({ error: error.toString() });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error({ error: error.toString() });
|
console.error({ error: error.toString() });
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+2
-7
@@ -36,21 +36,16 @@
|
|||||||
"integrity": "sha512-HobCAMnDDSrKfrMBrF5ySA8fKO8Qjkn2HDKysuV51sHrpXABKJFQt5OemIQgbnSMNWU0kZ0+FF9xRrivHHaDTg=="
|
"integrity": "sha512-HobCAMnDDSrKfrMBrF5ySA8fKO8Qjkn2HDKysuV51sHrpXABKJFQt5OemIQgbnSMNWU0kZ0+FF9xRrivHHaDTg=="
|
||||||
},
|
},
|
||||||
"apps/readosc": {
|
"apps/readosc": {
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jwetzell/osc": "0.2.2",
|
"@jwetzell/osc": "1.0.0",
|
||||||
"commander": "^11.0.0"
|
"commander": "^11.0.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"readosc": "src/main.js"
|
"readosc": "src/main.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"apps/readosc/node_modules/@jwetzell/osc": {
|
|
||||||
"version": "0.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@jwetzell/osc/-/osc-0.2.2.tgz",
|
|
||||||
"integrity": "sha512-HobCAMnDDSrKfrMBrF5ySA8fKO8Qjkn2HDKysuV51sHrpXABKJFQt5OemIQgbnSMNWU0kZ0+FF9xRrivHHaDTg=="
|
|
||||||
},
|
|
||||||
"apps/sendosc": {
|
"apps/sendosc": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
Reference in New Issue
Block a user