Socket
Socket
Sign inDemoInstall

@libp2p/record

Package Overview
Dependencies
5
Maintainers
6
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @libp2p/record

libp2p record implementation


Version published
Weekly downloads
4.2K
decreased by-22.14%
Maintainers
6
Install size
732 kB
Created
Weekly downloads
 

Readme

Source

@libp2p/record

libp2p.io Discuss codecov CI

libp2p record implementation

About

This is an implementation of the routing record format used by libp2p to store data in the datastore passed to the libp2p constructor.

Example - Deserialization

import { Libp2pRecord } from '@libp2p/record'

const buf = Uint8Array.from([0, 1, 2, 3])
const record = Libp2pRecord.deserialize(buf)

Example - Serialization

import { Libp2pRecord } from '@libp2p/record'

const key = Uint8Array.from([0, 1, 2, 3])
const value = Uint8Array.from([0, 1, 2, 3])
const timeReceived = new Date()

const record = new Libp2pRecord(key, value, timeReceived)
const buf = record.serialize()

Install

$ npm i @libp2p/record

Browser <script> tag

Loading this module through a script tag will make it's exports available as Libp2pRecord in the global namespace.

<script src="https://unpkg.com/@libp2p/record/dist/index.min.js"></script>

API Docs

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.

Keywords

FAQs

Last updated on 20 May 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc