npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@readymade/transmit

v3.1.4

Published

Swiss-army knife for communicating over WebRTC DataChannel, WebSocket or Touch OSC

Readme

@readymade/transmit

Swiss-army knife for communicating over WebRTC DataChannel, WebSocket or Touch OSC.

npm install @readymade/transmit
yarn add @readymade/transmit

Getting Started

Import Transmitter and instantiate with a configuration Object.

import { Transmitter, TransmitterConfig } from '@readymade/transmit';

const config: TransmitterConfig = {
  sharedKey: 'lobby',
  rtc: {
    iceServers,
  },
  serverConfig: {
    http: {
      protocol: 'http',
      hostname: 'localhost',
      port: 4449,
    },
    ws: {
      osc: {
        protocol: 'ws',
        hostname: 'localhost',
        port: 4445,
      },
      signal: {
        protocol: 'ws',
        hostname: 'localhost',
        port: 4446,
      },
      announce: {
        protocol: 'ws',
        hostname: 'localhost',
        port: 4447,
      },
      message: {
        protocol: 'ws',
        hostname: 'localhost',
        port: 4448,
      },
    },
  },
  onMessage,
  onConnect,
}

const transmitter = new Transmitter(config);

Messages

When signal and announce servers are configured, the instance of Transmitter will automatically attempt a handshake with a remote peer. If a peer is found, a WebRTC DataChannel peer to peer connection will open. To send a message over the data channel use the send method.

transmitter.send({ message: 'ping' });

If you want to send messages over WebSocket, use sendSocketMessage.

transmitter.sendSocketMessage({ message: 'ping' });

To send a message over TouchOSC, use sendTouchOSCMessage, ensuring the data your are sending follows the OSC protocol. Below is an example of sending a OSC message with type definitions.

transmitter.sendTouchOSCMessage('/OSCQUERY/Left Controls/Flip H', [
  {
    type: 'i',
    value: 1,
  },
]);

To listen for messages, inject a callback into the configuration. In the above example, onMessage would appear like so:

const onMessage = (message) => {
  if (message.payload.event === 'ping') {
    this.transmitter.send({ event: 'pong' });
  }
};

To react to a peer to peer connection, bind an onConnect callback to the configuration.

transit-server

For plug and play functionality use a Readymade transmit-server, a Node.js server that provides a WebRTC signaling server, WebSocket messaging channel, and WebSocket bridge for communicating over TouchOSC.

transmit-server is included in the Readymade starter code. Create a new Readymade project using the command npx primr my-app, renaming the directory my-app with your project name. transmit-server will be included in the project directory. After installing dependencies, run yarn build:transmit and yarn serve:transmit. Automatically, the WebSocket and Express servers should instantiate like so:

yarn serve:transmit
Express Server is listening on http://localhost:4449
Free ICE servers available by making a GET request to http://localhost:4449/ice
TouchOSC Message Server is listening on http://localhost:4445
Signal Server is listening on http://localhost:4446
Announce Server is listening on http://localhost:4447
Message Server is listening on http://localhost:4448

For more information about primr, read the Readymade documentation.