Code Monkey home page Code Monkey logo

cabal-node's Introduction

cabal-node

Node.js library for p2p functions for chat.

Usage

npm install cabal-node

API

Table of Contents

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.

cabal-node's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.