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

@bunchtogether/braid-client

v1.2.13

Published

[![CircleCI](https://circleci.com/gh/bunchtogether/braid-client-js.svg?style=svg)](https://circleci.com/gh/bunchtogether/braid-client-js) [![npm version](https://badge.fury.io/js/%40bunchtogether%2Fbraid-client.svg)](http://badge.fury.io/js/%40bunchtogeth

Downloads

14

Readme

Braid Client

CircleCI npm version codecov

WebSocket-based key-value synchronization.

See also:

API

Table of Contents

ConnectionError

Extends Error

Class representing a connection error

Parameters

CredentialsError

Extends Error

Class representing a credentials error

Parameters

SubscribeError

Extends Error

Class representing a subscribe error

Parameters

EventSubscribeError

Extends Error

Class representing an event subscribe error

Parameters

PublishError

Extends Error

Class representing an publishing error

Parameters

ServerRequestError

Extends Error

Class representing an error that interupts a pending server request, for example if a connection closes prematurely

Parameters

Client

Extends EventEmitter

Class representing a Braid Client

data

Primary data object. Like a native JS Map but with 'set' and 'delete' events.

setReconnectHandler

Set the reconnect handler. The handler determines if the reconnect should continue.

Parameters

Returns void

open

Connects to a server.

Parameters
  • address string Websocket URL of the server
  • credentials Object? Credentials to send

Returns Promise<void>

close

Close connection to server.

Parameters
  • code number? Websocket close reason code to send to the server
  • reason string? Websocket close reason to send to the server

Returns Promise<void>

sendCredentials

Send credentials to a server with an open connection.

Parameters
  • credentials Object? Credentials to send

Returns Promise<void>

subscribe

Subscribe to updates on a key.

Parameters
  • key string Key to request updates on

Returns Promise<void>

sendSubscribeRequest

Send subscribe request to server

Parameters
  • key string Key to request updates on

Returns Promise<void>

unsubscribe

Unsubscribe from updates on a key. If the callback parameter is not provided, all callbacks are unsubscribed.

Parameters
  • key string Key to stop updates on

Returns Promise<void>

addServerEventListener

Subscribe to a server event

Parameters
  • name string Name of the event to listen for
  • callback function (): void?

Returns Promise<void>

sendEventSubscribeRequest

Send event subscribe request to server

Parameters
  • name string Name of the event to listen for

Returns Promise<void>

removeServerEventListener

Unsubscribe from a server event. If the callback parameter is not provided, all callbacks are unsubscribed.

Parameters
  • name string Name of the event to stop listening
  • callback function (any): void?

Returns Promise<void>

startPublishing

Start publishing to a receiver

Parameters
  • name string Name of the receiver to start publishing to

Returns Promise<void>

publish

Publish message to a receiver

Parameters
  • name string Name of the receiver
  • message any Value to publish, should not contain undefined values

Returns Promise<void>

sendPublishRequest

Send event subscribe request to server

Parameters
  • name string Name of the event to listen for

Returns Promise<void>

stopPublishing

Stop publishing to a receiver.

Parameters
  • name string Name of the receiver to stop publishing to

Returns Promise<void>