Socket
Book a DemoInstallSign in
Socket

line-mesh

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

line-mesh

Universal communication adapter

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

line-mesh

line-mesh is a lightweight communication library that bears non-blocking interface and p2p scalable architecture. line-mesh is the cousin of line, they share very similar apis. line internally monitors connection health, and it pro-actively strives to achieve a stable connection.

line runs on Node.JS and all modern browsers through an identical API. Therefore, it is a good candidate for cross-platform applications.

Key Features

  • p2p: There is no server similar to bit-torrent, sopcast, popcorn-time 🔥
  • Cross platform: Works on MacOS, Linux, Windows and browsers
  • Developed in ES6 with Webpack, therefore we have a minified bundles that work nearly every platform without hassle
  • Apart from netflux, we support message responses and request timeouts
  • Easy configuring
  • Promise based API

Installation

Using npm

npm install line-mesh --save

Usage

Simple Responder

const adapter = new LineMesh('line-mesh-req-res');

adapter.on('hello', request => {
  console.log(`Event received from ${request.sender}`, request.payload);
  request.resolve({yeppa: 'xxx'});
});

adapter.connect();

Simple Requester

const adapter = new LineMesh('line-mesh-req-res');

adapter.on(LineMesh.Event.MEMBER_JOINED, ({id}) => {
  console.log(`New member with id=${id} joined network`);

  adapter
    .sendTo(id, 'hello', {foo: 'bar'})
    .then(response => {
      console.log('Got response', response);
    });
});

adapter.connect();

Documentation

Extended documentation can be found here.

License

Creative Commons License

line-mesh by mertdogar is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Keywords

webpack

FAQs

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.