remove tools in favor of my other osc repo

This commit is contained in:
Joel Wetzell
2026-05-19 14:42:44 -05:00
parent 67a6979c35
commit 1f49fe9ea7
20 changed files with 5 additions and 509 deletions
-22
View File
@@ -1,22 +0,0 @@
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
-22
View File
@@ -1,22 +0,0 @@
name: Publish readosc to npmjs
on:
push:
tags:
- 'readosc/*'
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=readosc
- name: Publish to NPM
run: npm publish --provenance --access=public --workspace=readosc
-22
View File
@@ -1,22 +0,0 @@
name: Publish sendosc to npmjs
on:
push:
tags:
- 'sendosc/*'
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=sendosc
- name: Publish to NPM
run: npm publish --provenance --access=public --workspace=sendosc
+2 -3
View File
@@ -1,5 +1,4 @@
# osc-js
Collection of OSC things written in JS/TS
Typescript implementation of OSC things written in TS and distributed as both ESM and CJS modules
- [osc encoding/decoding library](./packages/osc/)
- [cli for sending osc messages](./apps/sendosc/)
- [osc encoding/decoding library](./packages/osc/)
-1
View File
@@ -1 +0,0 @@
dist
-41
View File
@@ -1,41 +0,0 @@
![npm](https://img.shields.io/npm/v/makeosc)
# makeosc
Simple NodeJS script for generating OSC bytes output to stdout.
## Usage
```
Usage: makeosc [options]
simple util to make osc buffers
Options:
-V, --version output the version number
--address <address> OSC address
--args <args...> osc args (default: [])
--slip slip encode message (default: false)
--types <types...> osc arg types (choices: "s", "i", "f", "b", default: [])
-h, --help display help for command
```
- using npx `npx makeosc@latest --address /hello`
- install using `npm install -g makeosc@latest` and run `makeosc --address /hello`
## Notes
- `--types` option is a space seperate list of type characters that will determine what the corresponding argument type will be set to
- optional
- uses type codes from the OSC spec
- `--args` option is a space-separated list of arguments. If a corresponding type is not found in the `--types` option it will default to string (`s`).
- blobs (`b`) are to be entered as hex string representing the buffer to be sent so the ASCII string `hello` would be `68656c6c6f`
- the default protocol is UDP but can be changed to TCP using the `--protocol` flag
## Examples
- `makeosc --address /test --args 1.0`
- `makeosc --address /this/is/sent/via/tcp`
- `makeosc --address /test/with/types --args 1 2.0 three --types i f`
- note that `types` is not the same length as `args` so the remaining argument (`three`) will default to string
- `makeosc --address /blob --args 68656c6c6f --types b`
-27
View File
@@ -1,27 +0,0 @@
{
"name": "makeosc",
"version": "0.1.0",
"description": "Simple NodeJS utility for generating osc buffers",
"main": "src/main.js",
"bin": {
"makeosc": "src/main.js"
},
"files": [
"src/"
],
"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": "1.7.0",
"commander": "14.0.3",
"slip": "1.0.2"
}
}
-52
View File
@@ -1,52 +0,0 @@
#!/usr/bin/env node
const { Option, program } = require('commander');
const slip = require('slip');
const osc = require('@jwetzell/osc');
const { argToTypedArg } = require('./utils');
const packageInfo = require('../package.json');
program.name(packageInfo.name);
program.version(packageInfo.version);
program.description('simple util to make osc buffers');
program.addOption(new Option('--address <address>', 'OSC address').makeOptionMandatory());
program.addOption(new Option('--args <args...>', 'osc args').default([]));
program.addOption(new Option('--slip', 'slip encode message').default(false));
program.addOption(new Option('--types <types...>', 'osc arg types').choices(['s', 'i', 'f', 'b']).default([]));
program.addOption(
new Option('-f --format <format>', 'output format').choices(['bytes', 'json', 'f', 'b']).default('bytes')
);
program.action((options) => {
const { address, args, types, format } = options;
const typedArgs = args?.map((rawArg, index) => {
const argType = types[index] || 's';
return {
type: argType,
value: argToTypedArg(rawArg, argType),
};
});
const oscMsg = {
address,
args: typedArgs,
};
if (format === 'json') {
process.stdout.write(JSON.stringify(oscMsg));
} else if (format === 'bytes') {
let oscMsgBuffer = osc.messageToBuffer(oscMsg);
if (options.slip) {
oscMsgBuffer = slip.encode(oscMsgBuffer);
}
process.stdout.write(oscMsgBuffer);
}
});
program.parse();
process.stdout.on('error', (err) => {
if (err.code === 'EPIPE') {
process.exit(0);
}
});
-31
View File
@@ -1,31 +0,0 @@
const oscTypeConverterMap = {
s: {
fromString: (string) => string,
},
f: {
fromString: (string) => Number.parseFloat(string),
},
i: {
fromString: (string) => Number.parseInt(string, 10),
},
b: {
fromString: (string) => Buffer.from(string, 'hex'),
},
};
function argToTypedArg(rawArg, type = 's') {
const typeConverter = oscTypeConverterMap[type];
if (typeConverter === undefined) {
throw new Error('osc type error: unknown type '.concat(type));
}
if (typeConverter.fromString === undefined) {
throw new Error('osc type error: no string converter for type '.concat(type));
}
return typeConverter.fromString(rawArg);
}
module.exports = {
argToTypedArg,
};
-1
View File
@@ -1 +0,0 @@
dist
-20
View File
@@ -1,20 +0,0 @@
![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`
-27
View File
@@ -1,27 +0,0 @@
{
"name": "readosc",
"version": "0.2.0",
"description": "Simple NodeJS utility for parsing osc buffers from stdin",
"main": "src/main.js",
"bin": {
"readosc": "src/main.js"
},
"files": [
"src/"
],
"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": "1.7.0",
"commander": "14.0.3",
"slip": "1.0.2"
}
}
-46
View File
@@ -1,46 +0,0 @@
#!/usr/bin/env node
const { program, Option } = require('commander');
const osc = require('@jwetzell/osc');
const packageInfo = require('../package.json');
const slip = require('slip');
program.name(packageInfo.name);
program.version(packageInfo.version);
program.description('simple util to read osc packets from stdin');
program.addOption(new Option('--slip', 'slip encode message').default(false));
program.action((options) => {
const slipDecoder = new slip.Decoder({
onMessage: (msg) =>{
const [message, bytesAfterMessage] = osc.messageFromBuffer(msg);
printOSCMessage(message)
},
maxMessageSize: 209715200,
bufferSize: 2048
});
process.stdin.on('data', (data) => {
try {
if (options.slip){
slipDecoder.decode(data)
} else {
let remainingBytes = data;
while (remainingBytes.length > 0) {
try {
const [message, bytesAfterMessage] = osc.messageFromBuffer(remainingBytes);
remainingBytes = bytesAfterMessage;
printOSCMessage(message)
} catch (error) {
console.error({ error: error.toString() });
}
}
}
} catch (error) {
console.error({ error: error.toString() });
}
});
});
program.parse();
function printOSCMessage(oscMessage) {
console.log(JSON.stringify(oscMessage));
}
-1
View File
@@ -1 +0,0 @@
dist
-44
View File
@@ -1,44 +0,0 @@
![npm](https://img.shields.io/npm/v/sendosc)
# sendosc
Simple NodeJS script for sending OSC via TCP or UDP originally inspired by this [c++ utility](https://github.com/yoggy/sendosc) of the same name.
## Usage
```
Usage: sendosc [options]
simple util to sendosc
Options:
-V, --version output the version number
--protocol <protocol> Network protocol (choices: "tcp", "udp", default: "udp")
--host <host> the host to send osc to
--port <port> the port to send osc to
--address <address> OSC address
--args <args...> osc args (default: [])
--slip slip encode message (default: false)
--types <types...> osc arg types (choices: "s", "i", "f", "b", default: [])
-h, --help display help for command
```
- using npx `npx sendosc@latest --host 127.0.0.1 --port 9999 --address /hello`
- install using `npm install -g sendosc@latest` and run `sendosc --host 127.0.0.1 --port 9999 --address /hello`
## Notes
- `--types` option is a space seperate list of type characters that will determine what the corresponding argument type will be set to
- optional
- uses type codes from the OSC spec
- `--args` option is a space-separated list of arguments. If a corresponding type is not found in the `--types` option it will default to string (`s`).
- blobs (`b`) are to be entered as hex string representing the buffer to be sent so the ASCII string `hello` would be `68656c6c6f`
- the default protocol is UDP but can be changed to TCP using the `--protocol` flag
## Examples
- `sendosc --host 127.0.0.1 --port 8000 --address /test --args 1.0`
- `sendosc --protocol tcp --host 127.0.0.1 --port 8000 --address /this/is/sent/via/tcp`
- `sendosc --host 127.0.0.1 --port 8000 --address /test/with/types --args 1 2.0 three --types i f`
- note that `types` is not the same length as `args` so the remaining argument (`three`) will default to string
- `sendosc --host 127.0.0.1 --port 8000 --address /blob --args 68656c6c6f --types b`
-27
View File
@@ -1,27 +0,0 @@
{
"name": "sendosc",
"version": "1.0.1",
"description": "Simple NodeJS utility for sending osc",
"main": "src/main.js",
"bin": {
"sendosc": "src/main.js"
},
"files": [
"src/"
],
"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": "1.7.0",
"commander": "14.0.3",
"slip": "1.0.2"
}
}
-62
View File
@@ -1,62 +0,0 @@
#!/usr/bin/env node
const { Option, program } = require('commander');
const dgram = require('dgram');
const net = require('net');
const slip = require('slip');
const osc = require('@jwetzell/osc');
const { argToTypedArg } = require('./utils');
const packageInfo = require('../package.json');
program.name(packageInfo.name);
program.version(packageInfo.version);
program.description('simple util to sendosc');
program.addOption(new Option('--protocol <protocol>', 'Network protocol').choices(['tcp', 'udp']).default('udp'));
program.addOption(new Option('--host <host>', 'the host to send osc to').makeOptionMandatory());
program.addOption(new Option('--port <port>', 'the port to send osc to').makeOptionMandatory());
program.addOption(new Option('--address <address>', 'OSC address').makeOptionMandatory());
program.addOption(new Option('--args <args...>', 'osc args').default([]));
program.addOption(new Option('--slip', 'slip encode message').default(false));
program.addOption(new Option('--types <types...>', 'osc arg types').choices(['s', 'i', 'f', 'b']).default([]));
program.action((options) => {
const { host, port, address, args, types } = options;
const typedArgs = args?.map((rawArg, index) => {
const argType = types[index] || 's';
return {
type: argType,
value: argToTypedArg(rawArg, argType),
};
});
let oscMsgBuffer = osc.messageToBuffer({
address,
args: typedArgs,
});
if (options.slip) {
oscMsgBuffer = slip.encode(oscMsgBuffer);
}
if (options.protocol === 'tcp') {
const client = net.Socket();
client.on('error', (error) => {
console.error(error);
});
client.connect(port, host, () => {
client.write(oscMsgBuffer, () => {
client.destroy();
});
});
} else if (options.protocol === 'udp') {
const client = dgram.createSocket('udp4');
client.send(oscMsgBuffer, port, host, (error) => {
if (error) {
console.error(error);
}
client.close();
});
}
});
program.parse();
-31
View File
@@ -1,31 +0,0 @@
const oscTypeConverterMap = {
s: {
fromString: (string) => string,
},
f: {
fromString: (string) => Number.parseFloat(string),
},
i: {
fromString: (string) => Number.parseInt(string, 10),
},
b: {
fromString: (string) => Buffer.from(string, 'hex'),
},
};
function argToTypedArg(rawArg, type = 's') {
const typeConverter = oscTypeConverterMap[type];
if (typeConverter === undefined) {
throw new Error('osc type error: unknown type '.concat(type));
}
if (typeConverter.fromString === undefined) {
throw new Error('osc type error: no string converter for type '.concat(type));
}
return typeConverter.fromString(rawArg);
}
module.exports = {
argToTypedArg,
};
+3 -28
View File
@@ -8,7 +8,6 @@
"name": "osc",
"version": "0.0.0",
"workspaces": [
"apps/*",
"packages/*"
],
"devDependencies": {
@@ -23,6 +22,7 @@
},
"apps/makeosc": {
"version": "0.1.0",
"extraneous": true,
"license": "MIT",
"dependencies": {
"@jwetzell/osc": "1.7.0",
@@ -35,6 +35,7 @@
},
"apps/readosc": {
"version": "0.2.0",
"extraneous": true,
"license": "MIT",
"dependencies": {
"@jwetzell/osc": "1.7.0",
@@ -47,6 +48,7 @@
},
"apps/sendosc": {
"version": "1.0.1",
"extraneous": true,
"license": "MIT",
"dependencies": {
"@jwetzell/osc": "1.7.0",
@@ -1068,15 +1070,6 @@
"node": ">=20.19.0"
}
},
"node_modules/commander": {
"version": "14.0.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
"integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
"license": "MIT",
"engines": {
"node": ">=20"
}
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -1702,10 +1695,6 @@
"node": "20 || >=22"
}
},
"node_modules/makeosc": {
"resolved": "apps/makeosc",
"link": true
},
"node_modules/minimatch": {
"version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
@@ -1961,10 +1950,6 @@
],
"license": "MIT"
},
"node_modules/readosc": {
"resolved": "apps/readosc",
"link": true
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
@@ -2086,10 +2071,6 @@
"node": ">=10"
}
},
"node_modules/sendosc": {
"resolved": "apps/sendosc",
"link": true
},
"node_modules/shebang-command": {
"version": "2.0.0",
"dev": true,
@@ -2109,12 +2090,6 @@
"node": ">=8"
}
},
"node_modules/slip": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/slip/-/slip-1.0.2.tgz",
"integrity": "sha512-XrcHe3NAcyD3wO+O4I13RcS4/3AF+S9RvGNj9JhJeS02HyImwD2E3QWLrmn9hBfL+fB6yapagwxRkeyYzhk98g==",
"license": "(MIT OR GPL-2.0)"
},
"node_modules/synckit": {
"version": "0.11.12",
"resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.12.tgz",
-1
View File
@@ -17,7 +17,6 @@
"format:write": "prettier ./ --write"
},
"workspaces": [
"apps/*",
"packages/*"
],
"devDependencies": {