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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nodertc/datachannel

v1.0.0

Published

WebRTC Data Channel Establishment Protocol

Downloads

10

Readme

@nodertc/datachannel

stability-experimental Build Status npm node license downloads Coverage Status telegram

WebRTC Data Channel Establishment Protocol. Supported RFC:

Usage

const { createChannel } = require('@nodertc/datachannel');

const input = createSctpSourceStream({ id: 1 });
const output = createSctpTargetStream({ id: 1 });

const channel = createChannel({ input, output, label: 'nodertc' });

channel.on('data', data => {
  console.log('Channel %s says:', channel.label, data.toString())
});

API

  • createChannel(options: Options): Channel

Creates the Data Channel.

  • Options.input: stream.Readable

Source stream.

  • Options.output: stream.Writable

Target stream.

  • Options.negotiated: boolean, default false

The default value of false tells the user agent to announce the channel in-band and instruct the other peer to dispatch a corresponding Channel object. If set to true, it is up to the application to negotiate the channel.

  • Options.label: string, default ""

A label that can be used to distinguish this Channel object from other one.

  • Options.protocol: string, default ""

Subprotocol name used for this channel.

  • Options.priority: number, default 0

Priority of this channel.

  • Options.ordered: boolean, default false

The type of the delivery. Default false.

  • Options.retries: number, optional

The number of retransmissions.

  • Options.lifetime: number, optional

The maximum lifetime in milliseconds.

  • class Channel

This class is an abstraction of the Data Channel. A Channel is also a duplex stream, so it can be both readable and writable, and it is also a EventEmitter.

  • Channel.label: string, readonly

The name of the Data Channel.

  • Channel.priority: number, readonly

The priority of the Data Channel.

  • Channel.protocol: string, readonly

The name of a protocol registered in the 'WebSocket Subprotocol Name Registry'.

  • Channel.type: number, readonly

Get the channel type.

  • Channel.ordered: boolean, readonly

Get the type of the delivery.

  • Channel.negotiated: boolean, readonly

Returns true if the Data Channel was negotiated by the application, or false otherwise.

  • Channel.reliability: number, readonly

For reliable Data Channels this field MUST be set to 0 on the sending side and MUST be ignored on the receiving side. If a partial reliable Data Channel with limited number of retransmissions is used, this field specifies the number of retransmissions. If a partial reliable Data Channel with limited lifetime is used, this field specifies the maximum lifetime in milliseconds.

  • Channel.close()

Closes the channel. The input and output channels keeps untouched.

License

MIT, 2018 © Dmitriy Tsvettsikh