Socket
Socket
Sign inDemoInstall

@greymass/buoy

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@greymass/buoy

Client for buoy message forwarder


Version published
Weekly downloads
792
increased by1.67%
Maintainers
3
Weekly downloads
 
Created
Source

buoy-client

Client for buoy message forwarder.

Installation

The @greymass/buoy package is distributed as a module on npm.

yarn add @greymass/buoy
# or
npm install --save @greymass/buoy

Usage

Send a message.

import {send} from '@greymass/buoy'

await send('hello', {service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})

Receive a message.

import {receive} from '@greymass/buoy'

const message = await receive({service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})

Listen for a continuous stream of messages.

import {Listener} from '@greymass/buoy'

const listener = new Listener({service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})

listener.on('message', (message) => {
    console.log('message', message)
})

// make sure to subscribe to the error event or they will be thrown
listener.on('error', (error) => {
    console.warn('listener error', error)
})

Developing

You need Make, node.js and yarn installed.

Clone the repository and run make to checkout all dependencies and build the project. See the Makefile for other useful targets. Before submitting a pull request make sure to run make lint.


Made with ☕️ & ❤️ by Greymass, if you find this useful please consider supporting us.

FAQs

Package last updated on 09 Nov 2023

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