Skip to content

Make a session from a Hypercore that can auto cancel all inflight requests / downloads.

License

Notifications You must be signed in to change notification settings

mafintosh/hypercore-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hypercore-session

Make a session from a Hypercore that can auto cancel all inflight requests / downloads.

npm install hypercore-session

Usage

const HypercoreSession = require('hypercore-session')

const session = new HypercoreSession(feed)

// get a block
const block = await session.get(42)

// get a bunch of blocks
await session.download({ start: 0, end: 42 })

// cancel all currently inflight
session.cancel()

License

MIT

About

Make a session from a Hypercore that can auto cancel all inflight requests / downloads.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published