New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@m-onz/cohort

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@m-onz/cohort

connected

latest
Source
npmnpm
Version
6.0.0
Version published
Maintainers
1
Created
Source

cohort

p2p discovery layer, identity and messaging for node.js & the browser

Events

message


var cohort = require('@m-onz/cohort')

var Peer = cohort('demo')

Peer.on('message', function (message) {
  console.log(Peer.peerID, '> ', message)
})

Pass in identity


var cid = require('@m-onz/cohort-id')

var Peer = cohort('demo', cid.id)

var Peer = cohort('demo', {
  publicKey: '',
  secretKey: '',
  boxPublicKey: '',
  boxSecretKey: ''
})

Peer.on('message', function (message) {
  console.log(Peer.peerID, '> ', message)
})

Methods

connected


Peer.connected(function (e, peers) {
  console.log(peers)
})

send


Peer.send('peerID', 'hello peer!')

broadcast


Peer.broadcast('hello world!')

Install

npm i @m-onz/cohort

FAQs

Package last updated on 08 Oct 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