Socket
Socket
Sign inDemoInstall

cabal-headless

Package Overview
Dependencies
148
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cabal-headless

a headless client for cabal, a distributed p2p group chat


Version published
Maintainers
4
Install size
59.5 MB
Created

Readme

Source

Headless

Headless makes it easy to write experiments ontop of cabal.

Usage

There are a couple of options you can provide when creating a new headless instance
var headless = new Headless(opts)

opts.temp = false

store all data in memory

opts.completeLog = false

stream all messages from beginning to end

var Headless = require("cabal-headless")

var headless = new Headless(cabalKey, { opts.temp: false })
headless.post({
    type: "chat/text",
    channel: "default",
    message: "welcome to cabal"
})

headless.nick("cabalist")

headless.connect() // connect to the cabal's swarm
headless.disconnect() // disconnect from the swarm
headless.onPeerConnected(function (peer) {
    console.log("peer connected")
})

headless.onPeerDisonnected(function (peer) {
    console.log("peer disconnected")
})

headless.onMessageReceived(function (msg) {
    console.log("new message", msg)
})

headless.id(function (id) {
    console.log("my peer's id:", id)
})

var connectedPeers = headless.peers()

Keywords

FAQs

Last updated on 20 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc