characterworks-client
v0.1.0
Published
TypeScript HTTP client for controlling CharacterWorks from Node.js and related tools.
Maintainers
Readme
CharacterWorks HTTP Client (characterworks-client)
TypeScript HTTP client for controlling CharacterWorks from Node.js and related tools.
This library is extracted from the Stream Deck plugin so it can be reused by other tools (Companion modules, CLIs, bespoke automation, etc.).
Installation
npm install characterworks-clientQuick start
import {
sendCommand,
createTriggerCommand,
type CharacterWorksConfig,
} from 'characterworks-client'
const config: CharacterWorksConfig = {
host: '127.0.0.1',
port: 7000,
}
const command = createTriggerCommand('play_motions', 'motion_1,motion_2', 'preview')
await sendCommand(command, config)API surface
From characterworks-client you can import:
- Types:
CharacterWorksConfigCharacterWorksChannelTriggerActionTriggerCommandSetTextCommandActivateGridCommandCharacterWorksCommand
- Command helpers:
createTriggerCommand(action, motionNames, channel)createSetTextCommand(motionName, textLayer, value, channel)createActivateGridCommand(gridName, row, column)
- Transport:
sendCommand(command, config)– POSTs JSON tohttp://host:port/with a 10s timeout.
Development
npm install
npm run lint
npm test
npm run build