{"id":13687133,"url":"https://github.com/jensstigaard/node-vmix","last_synced_at":"2025-05-01T12:32:39.371Z","repository":{"id":46278106,"uuid":"236684820","full_name":"jensstigaard/node-vmix","owner":"jensstigaard","description":"NodeJS vMix utility to easily send commands and receive info such as xml data or real time tally from a vMix instance","archived":false,"fork":false,"pushed_at":"2024-03-25T14:21:03.000Z","size":557,"stargazers_count":23,"open_issues_count":3,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-26T04:03:05.085Z","etag":null,"topics":["livestreaming","vmix"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jensstigaard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://www.paypal.me/stigaard"]}},"created_at":"2020-01-28T07:59:58.000Z","updated_at":"2024-06-19T09:53:42.562Z","dependencies_parsed_at":"2024-03-25T15:54:58.835Z","dependency_job_id":null,"html_url":"https://github.com/jensstigaard/node-vmix","commit_stats":{"total_commits":172,"total_committers":10,"mean_commits":17.2,"dds":"0.41860465116279066","last_synced_commit":"8f357fe625a150af0aaa8572e1eab8f57d8d8aa9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jensstigaard%2Fnode-vmix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jensstigaard%2Fnode-vmix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jensstigaard%2Fnode-vmix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jensstigaard%2Fnode-vmix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jensstigaard","download_url":"https://codeload.github.com/jensstigaard/node-vmix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224175776,"owners_count":17268389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["livestreaming","vmix"],"created_at":"2024-08-02T15:00:49.351Z","updated_at":"2024-11-12T10:30:44.401Z","avatar_url":"https://github.com/jensstigaard.png","language":"TypeScript","funding_links":["https://www.paypal.me/stigaard"],"categories":["Third-party software and development"],"sub_categories":["Libraries"],"readme":"# node-vmix\n\nNodeJS vMix API utility to enable easy setup to communicate with vMix instance via TCP socket or HTTP alternatively.\n\nIt is recommended to use TCP, however, there is currently not implemented feedback/response.\nIt is possible to implement this yourself if necessary, by analysing the responses, but it is not supported out of the box.\n\n[![package json version](https://img.shields.io/github/package-json/v/jensstigaard/node-vmix.svg)](https://github.com/jensstigaard/node-vmix)\n[![npm version](https://badge.fury.io/js/node-vmix.svg)](https://www.npmjs.com/package/node-vmix)\n[![npm downloads](https://img.shields.io/npm/dm/node-vmix)](https://www.npmjs.com/package/node-vmix)\n\n[![NPM Badge](https://nodei.co/npm/node-vmix.png)](https://npmjs.com/package/node-vmix)\n\nThis code previously were found in the vmix-js-utils but are now branched out in its own package to enable usage of the vmix-js-utils to be used in a clean frontend environment (non-NodeJS), and also to give a better experience for the users. Are you looking for vMix utility for your js frontend? Take a look at [vmix-js-utils](https://github.com/jensstigaard/vmix-js-utils) for more info.\nBoth packages are available with npm - see [my npm profile](https://www.npmjs.com/~jensstigaard).\n\n# Purpose\nnode-vmix consists of two modules - one for TCP connection, one for HTTP.\nEach can be used on its own, but usually it makes more sense to make it interplay with some of the other modules.\nThe modules are coded as classes, meaning that they are constructed with specific parameters, e.g. that the instanciation of a connection needs a host and a port.\n\n\n# Quick start\n```javascript\nconst { ConnectionTCP } = require('node-vmix')\n\nconst connection = new ConnectionTCP('localhost')\n\n// Listener for xml state data\nconnection.on('xml', xmlData =\u003e {\n // Your logic here!\n // See example to parse the XML correctly\n})\n\n// Listener for tally\nconnection.on('tally', tally =\u003e {\n // Your logic here!\n})\n\n// Listener for data such as tally\nconnection.on('data', data =\u003e {\n // Your logic here!\n})\n\nconnection.on('connect', () =\u003e {\n  // Request vMix API XML state by sending message 'XML'\n  connection.send('XML')\n\n  // Request vMix tally info by sending message 'TALLY'\n  connection.send('TALLY')\n})\n```\nNote: One should check whether the connection is actually established before attempting sending message to the socket.\n\n\n\n# Documentation\n\nPlease visit the documentation here: https://jensstigaard.github.io/node-vmix/.\n\nThe documentation includes definition and description of classes and type.\n\n\n## Installation and use\n### [NPM](https://www.npmjs.com/package/node-vmix)\nThe utilities are published at npmjs as a package for  [NodeJS](https://nodejs.org/en/), meaning that you can easily add the utilities as a dependency in your project using npm.\n```sh\nnpm install node-vmix --save\n# or 'yarn add node-vmix'\n```\n\nIn your code the simplest way to import the modules is the following:\n\n```javascript\nconst { Connection } = require('node-vmix')\n// or ES6 import syntax:  import { Connection } from 'node-vmix'\n\nconst connection1 = new Connection('localhost')\nconst connection2 = new Connection('192.168.1.50')\n\nconnection1.send({ Function: 'Cut' })\nconnection2.send({ Function: 'Merge' })\n```\n\nYou are also able to import all of the modules as a gathered variable, less elegant way:\n\n```javascript\nconst vMix = require('node-vmix')\n\nconst connection1 = new vMix.Connection('localhost')\nconst connection2 = new vMix.Connection('192.168.1.50')\n\nconnection1.send({ Function: 'Cut' })\nconnection2.send({ Function: 'Merge' })\n```\n\n\n# Examples and use\n## Electron example\nLooking for a full blown example project? See the repositories:\n * [audio-matrix-vmix-electron](https://github.com/jensstigaard/audio-matrix-vmix-electron)\n * [simple-vmix-switcher-electron](https://github.com/jensstigaard/simple-vmix-switcher-electron)\n * [vinproma](https://github.com/jensstigaard/vinproma) (vMix Input Progress Monitor App)\n \nThese apps are using this library for vMix connection. They are built with ElectronJS and can be compiled for both Windows, Mac or Linux platforms.\n\n## Code snippet examples\nHere are some basic example of how to use the library\n### Connection TCP\n * Send API commands (functions)\n   * [Send single command example](../../blob/master/examples/connection-tcp/send-commands/single.js)\n   * [Send multiple commands example](../../blob/master/examples/connection-tcp/send-commands/multiple.js)\n   * [Send multiple commands mixed strings/objects example](../../blob/master/examples/connection-tcp/send-commands/multiple-mixed.js)\n * Read XML API\n   * [Retrieve all inputs from vMix XML state - Basic example](../../blob/master/examples/connection-tcp/retrieve-state-basic.js)\n * Misc\n   * [Read or subscribe to tally](../../blob/master/examples/connection/tcp/tally.js)\n   * [vMix version](../../blob/master/examples/connection/tcp/get-vmix-version.js)\n\n\nLegacy:\n * [CommandSenderHTTP example](../../blob/master/examples/command-sender-http.js)\n * [StateFetcher Basic example](../../blob/master/examples/state-fetcher-basic.js)\n\n\n\n## Standalone project / Fork\nThe code can be cloned and tested as needed from the source code.\n\nClone repository and go into directory\n```sh\ngit clone https://github.com/jensstigaard/node-vmix.git\ncd node-vmix\n```\nInstall dependencies\n```sh\nnpm install # or 'yarn'\n```\nCompile TypeScript source code to JavaScript\n```sh\nnpm install # or 'yarn'\n```\nRun tests\n```sh\nnpm test # or 'yarn test'\n\n```\n\n# Contribution\nYou are more than welcome to contribute to the repository.\nFork the repo and make a pull request with the changes.\n\nAs you can see in the list on the right side, others have done it already!\n\n\n# Roadmap\n - TCP command sender: feedback/responses on commands sent\n - More tests\n - Perhaps more functionality\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjensstigaard%2Fnode-vmix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjensstigaard%2Fnode-vmix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjensstigaard%2Fnode-vmix/lists"}