Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fabianbormann/meerkat

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fabianbormann/meerkat

Browser-to-browser networking built on WebTorrent

  • 1.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Meerkat

Meerkat aims to be a typescript bowser-based reimplementation of bugout: A browser-to-browser networking built on WebTorrent

Release semantic-release: angular

🚀 Getting Started

npm i @fabianbormann/meerkat

🤖 Use Meerkat as a Server

import Meerkat from '@fabianbormann/meerkat';

const meerkat = new Meerkat({ seed: localStorage['bugout-demo-server-seed'] });
localStorage['meerkat-server-seed'] = meerkat.seed;

let connected = false;
meerkat.on('connections', (clients) => {
  if (clients === 0 && connected === false) {
    connected = true;
    console.log('[info]: server ready');
  }
  console.log(`[info]: ${clients} clients connected`);
});

meerkat.register('hello', (address, args, callback) => {
  console.log(
    `[info]: rpc call invoked by address ${address} into window.cardano`
  );
  callback('hello world');
});

console.log(`Share this address ${meerkat.address} with your clients`);

🥸 Use Meerkat as a Client

import Meerkat from '@fabianbormann/meerkat';

const meerkat = new Meerkat({ identifier: 'YOUR_SERVER_ADDRESS' });

meerkat.on('server', () => {
  console.log('[info]: connected to server');
  meerkat.rpc('YOUR_SERVER_ADDRESS', 'hello', {}, (response) =>
    console.log(response)
  );
});

Keywords

FAQs

Package last updated on 10 Dec 2022

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