Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

hypercore-ready

0.2.0 • Public • Published

hypercore-ready

Wait for 1 more or more hypercores to be ready.

Installation

$ npm install hypercore-ready --save

Usage

const ready = require('hypercore-ready')
 
ready(...hypercores, (err) => {
  // called when all hypercores are ready
})

API

ready(...hypercores[, callback])

ready(hypercores[, callback])

await ready(hypercores)

Waits for all given hypercores to be ready calling callback(err, pending, total) when all are ready or when an error occurs.

const cores = [ ...hypercores ]
 
ready(...cores, callback)
// or
ready(cores)
// or
await ready(cores)

License

MIT

Install

npm i hypercore-ready

DownloadsWeekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

4.25 kB

Total Files

5

Last publish

Collaborators

  • avatar