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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rtc-lib

v0.5.7

Published

An experimental promise based WebRTC library

Readme

rtc-lib

What is this?

This is a WebRTC client library/abstraction layer. It is inspired by palava-client and attempts to offer users and developers a better experience.

The design goals and principles are

  • allow simple code for basic usage as well as complex usage scenarios
  • hide complexity of WebRTC
  • heavy use of Promises
  • support for multiple Streams and DataChannels
  • consistent handling of errors and success notifications

How to use this?

The central element of the library is a Room. Multiple users, which are called Peer, can join a room and will create peer to peer connections to each other. You can send audio/video data to the peers through this connection, this is represented by a Stream, or send custom data using a DataChannel.

All streams added to the local peer using addStream() will be sent to all peers which are in the room. If you want to send a stream only to specific peers you can add them later using addStream() on the remote peer as soon as they are encountered. The same applies to data channels.

Here is a simple example:

// create a room
var room = new rtc.Room("wss://rtc.innovailable.eu/testroom");

// create a local stream from the users camera
var stream = room.local.addStream();

// display that stream
var ve = new rtc.MediaDomElement($('video'), stream);

// get notified whenever we meet a new peer
room.on('peer_joined', function(peer) {
    // create a video tag for the peer
    var view = $('<video>');
    $('body').append(view);
    var ve = new rtc.MediaDomElement(view, peer);

    // remove the tag after peer left
    peer.on('left', function() {
        view.remove();
    });
});

// join the room
room.connect();

This can be considered a minimal example implementing a multi user video chat. For your own implementation you might want to have more control over the workflow and handle errors.

For a more complex example have a look at the example folder. You can run this code using make example which will create a server which includes everything you need. Feel free to play around with this test code to get to know the API.

The complete API documentation is embedded as YUIDoc in the source code. You can create an HTML page from it using make doc or view it online here.

What else do I need?

You will need a signaling server to enable the peers to find each other and establish the peer to peer connections. rtc-lib supports multiple different signaling protocols including calling-signaling and the palava protocol (implemented by signal tower and others). You could also write your own signaling server or implement another signaling protocol.

It is also recommended to use a STUN server which will allow peers to connect through routers and firewalls. If you do not use one only clients on the same network would be able to connect to each other. There are several STUN servers open for public use or you can set up your own STUN server using one of multiple open source projects.

A TURN server can be added to allow connections in nearly all scenarios.