mirror of
https://github.com/jwetzell/osc-js.git
synced 2026-08-20 22:39:00 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| acc93189a9 | |||
| 180c9ff76a | |||
| 25fe42415e | |||
| fd6949c897 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "readosc",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"description": "Simple NodeJS utility for parsing osc buffers from stdin",
|
||||
"main": "src/main.js",
|
||||
"bin": {
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jwetzell/osc": "0.2.2",
|
||||
"@jwetzell/osc": "1.0.0",
|
||||
"commander": "^11.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,18 @@ program.description('simple util to read osc packets from stdin');
|
||||
program.action(() => {
|
||||
process.stdin.on('data', (data) => {
|
||||
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) {
|
||||
console.error({ error: error.toString() });
|
||||
}
|
||||
|
||||
Generated
+2
-7
@@ -36,21 +36,16 @@
|
||||
"integrity": "sha512-HobCAMnDDSrKfrMBrF5ySA8fKO8Qjkn2HDKysuV51sHrpXABKJFQt5OemIQgbnSMNWU0kZ0+FF9xRrivHHaDTg=="
|
||||
},
|
||||
"apps/readosc": {
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jwetzell/osc": "0.2.2",
|
||||
"@jwetzell/osc": "1.0.0",
|
||||
"commander": "^11.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"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": {
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
|
||||
Reference in New Issue
Block a user