New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

libp2p

Package Overview
Dependencies
Maintainers
1
Versions
1015
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libp2p

Node.js implementation of libp2p

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
decreased by-25.7%
Maintainers
1
Weekly downloads
 
Created
Source

node-libp2p

[ Build Status](https://travis-ci.org/diasdavid/node-libp2p) Dependency Status js-standard-style

Node.js implementation of libp2p

Interface

This is a work in progress, interface might change at anytime

libp2p expects a Record Store interface, a swarm and one or more Peer Routers that implement the Peer Routing, the goal is to keep simplicity and plugability while the remaining modules execute the heavy lifting.

libp2p becomes very simple and basically acts as a glue for every module that compose this library. Since it can be highly customized, it requires some setup. What we recommend is to have a libp2p build for the system you are developing taking into account in your needs (e.g. for a browser working version of libp2p that acts as the network layer of IPFS, we have a built and minified version that browsers can require)

Setting everything up

var Libp2p = require('libp2p')

// set up a Swarm, Peer Routing and Record Store instances, the last two are optional

var p2p = new Libp2p(swarm, [peerRouting, recordStore])

Dialing and listening

p2p.swarm.dial(peerInfo, options, protocol, function (err, stream) {}) p2p.swarm.handleProtocol(protocol, options, handlerFunction)

Using Peer Routing

p2p.routing.findPeers(key, function (err, peerInfos) {})

Using Records

p2p.record.get(key, function (err, records) {}) p2p.record.store(key, record)

Stats

Notes

Img for ref (till we get a better graph)

Keywords

FAQs

Package last updated on 26 Sep 2015

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