add readosc tool

This commit is contained in:
2024-10-09 19:10:08 -05:00
parent b393397972
commit 8e8d96fbb4
8 changed files with 145 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
name: Check readosc builds
on:
pull_request:
branches:
- main
paths:
- 'apps/readosc/**'
jobs:
build-webui:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Install Node.js dependencies
run: npm ci --workspace readosc
- run: npm run build --workspace readosc
+24
View File
@@ -0,0 +1,24 @@
name: Publish makeosc to npmjs
on:
push:
tags:
- 'makeosc/*'
jobs:
publish:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: './package-lock.json'
- name: Install Node.js dependencies
run: npm ci --workspace=makeosc
- name: Publish to NPM
run: npm publish --provenance --access=public --workspace=makeosc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "makeosc",
"version": "0.0.1",
"version": "0.1.0",
"description": "Simple NodeJS utility for generating osc buffers",
"main": "dist/main.js",
"bin": {
+1
View File
@@ -0,0 +1 @@
dist
+20
View File
@@ -0,0 +1,20 @@
![npm](https://img.shields.io/npm/v/readosc)
# readosc
Simple NodeJS script for parsing OSC bytes from stdin.
## Usage
```
Usage: readosc [options]
simple util to read osc packets from stdin
Options:
-V, --version output the version number
-h, --help display help for command
```
- using npx `npx readosc@latest`
- install using `npm install -g readosc@latest` and run `readosc`
+33
View File
@@ -0,0 +1,33 @@
{
"name": "readosc",
"version": "0.1.0",
"description": "Simple NodeJS utility for parsing osc buffers from stdin",
"main": "dist/main.js",
"bin": {
"readosc": "dist/main.js"
},
"scripts": {
"prebuild": "rimraf dist",
"build": "esbuild src/main.js --bundle --platform=node --outfile=dist/main.js",
"prepack": "npm run build"
},
"author": {
"name": "Joel Wetzell",
"email": "me@jwetzell.com",
"url": "https://jwetzell.com"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jwetzell/osc-js.git"
},
"license": "MIT",
"dependencies": {
"@jwetzell/osc": "0.2.2",
"commander": "^11.0.0",
"slip": "^1.0.2"
},
"devDependencies": {
"esbuild": "0.24.0",
"rimraf": "6.0.1"
}
}
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env node
const { program } = require('commander');
const osc = require('@jwetzell/osc');
const packageInfo = require('../package.json');
program.name(packageInfo.name);
program.version(packageInfo.version);
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));
} catch (error) {
console.error({ error: error.toString() });
}
});
});
program.parse();
+21 -1
View File
@@ -19,7 +19,7 @@
}
},
"apps/makeosc": {
"version": "0.0.1",
"version": "0.1.0",
"license": "MIT",
"dependencies": {
"@jwetzell/osc": "0.2.2",
@@ -34,6 +34,22 @@
"rimraf": "6.0.1"
}
},
"apps/readosc": {
"version": "0.1.0",
"license": "MIT",
"dependencies": {
"@jwetzell/osc": "0.2.2",
"commander": "^11.0.0",
"slip": "^1.0.2"
},
"bin": {
"readosc": "dist/main.js"
},
"devDependencies": {
"esbuild": "0.24.0",
"rimraf": "6.0.1"
}
},
"apps/sendosc": {
"version": "1.0.1",
"license": "MIT",
@@ -2843,6 +2859,10 @@
"license": "MIT",
"peer": true
},
"node_modules/readosc": {
"resolved": "apps/readosc",
"link": true
},
"node_modules/reflect.getprototypeof": {
"version": "1.0.6",
"dev": true,