0.0.0 • Published 2 years ago

@libp2p/peer-list v0.0.0

Weekly downloads
-
License
Apache-2.0 OR MIT
Repository
github
Last release
2 years ago

libp2p-peer-list

a list of peer ids

Table of Contents

Description

A list of peerIDs with the methods you'd expect from a list.

PeerIds cache stringified versions of themselves so this should be a cheap operation.

Example

import { peerList } from '@libp2p/peer-list'
import { peerIdFromString } from '@libp2p/peer-id'

const list = peerList()
list.add(peerId)

list.has(peerId) // true
list.has(peerIdFromString(peerId.toString())) // true

Installation

$ npm i @libp2p/peer-list

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.