Socket
Socket
Sign inDemoInstall

cabal-node

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cabal-node

p2p db functions for chat


Version published
Maintainers
2
Created
Source

cabal-node

Node.js library for p2p functions for chat.

Usage

npm install cabal-node

API

Table of Contents
  • Cabal

Cabal

Create a new Cabal. This is the object handling all local nickname -> cabal interactions for a single user.

Parameters

  • storage (string | function) A hyperdb compatible storage function, or a string representing the local data path.
  • href string The dat link
  • opts Object Options include: username
onconnection

When a connection is made. Auto-authorizes new peers to write to the local database. Maintains the local view of visible users.

Parameters

  • peer Object The discovery-swarm peer emitted from the 'connection' or 'disconnection' event
joinChannel

Join a channel.

Parameters

  • channel String The channel to join.
leaveChannel

Leave a channel.

Parameters

  • channel String The channel to leave.
createReadStream

Create a readable stream for the cabal channel.

Parameters

  • channel String The channel you want to read from.
message

Create a message.

Parameters

  • channel String The channel to create the message.
  • message String The message to write.
  • opts Object Options: date, username, type (i.e. message type)
  • done function When message has been successfully added.
replicate

Replication stream for the cabal. Shares the username with the other peers it is connecting with.

Keywords

FAQs

Package last updated on 14 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc