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

webrtc4two

v0.0.0

Published

A framework for P2P communication using webRTC and Socket IO. Purpose is to make web-based P2P communication easily implemented.

Readme

#webrtc4two A framework for P2P communication using webRTC and Socket IO. Purpose is to make web-based P2P communication easily implemented.

Installation

 npm install webrtc4two

Getting started

Starting the server

node app.js

Opening the sample client

Use chrome and browse to http://localhost:3303/pc.html (note: you will need two clients to test this sample). Then, follow the screen to start the communication session.

API

Method

webcomm.start() // start local media stream webcomm.call() // call anyone in the room webcomm.hangup() // hangup call

Properties

webcomm.url // web socket url webcomm.room // name of the room to join

Events

webcomm.onStart(function(){ //your callback code });

webcomm.onCall(function(){ //your callback code });

webcomm.onHangup(function(){ //your callback code });

webcomm.ongotStream(function(){ //your callback code });

Example code

<!DOCTYPE html>
<html>
<head>
<title>PeerConnection Demo 1</title>
<!-- Load the polyfill to switch-hit between Chrome and Firefox -->
<script src="lib/webrtc-adapter/js/adapter.js"></script>
<style>
video {
  border:5px solid black;
  width:480px;
  height:360px;
}
button {
  font: 18px sans-serif;
  padding: 8px;
}
textarea {
  font-family: monospace;
  margin: 2px;
  width:480px;
  height:640px;
}
</style>
</head>
<body>
<video id="vid1" autoplay="true" muted="true"></video>
<video id="vid2" autoplay></video>
<br>
<button id="btn1" onclick="webcomm.start()">Start</button>
<button id="btn2" onclick="webcomm.call()">Call</button>
<button id="btn3" onclick="webcomm.hangup()">Hang Up</button>
<br>
<xtextarea id="ta1"></textarea>
<xtextarea id="ta2"></textarea>
<script src="/socket.io/socket.io.js"></script>
<script src="lib/webcomm/js/webcomm-1.0.js"></script>

<script>
btn1.disabled = false;
btn2.disabled = true;
btn3.disabled = true;

webcomm.url='http://localhost:3303';
webcomm.room='default';
webcomm.onStart(function(){
	trace("Requesting local stream");
	btn1.disabled = true;
});
webcomm.onCall(function(){
  btn2.disabled = true;
  btn3.disabled = false;
  trace("Starting call");
});
webcomm.onHangup(function(){
  trace("Ending call");	
  btn3.disabled = true;
  btn2.disabled = false;
});
webcomm.ongotStream(function(){
	btn2.disabled = false;
});


</script>
</body>
</html>

##License

MIT license - http://www.opensource.org/licenses/mit-license.php