Skip to content

dwebprotocol/ddatabase-session

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ddatabase/session

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

npm install @ddatabase/session

Usage

const DDatabase Session = require('@ddatabase/session')

const session = new DDatabase Session(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

Create a dDatabase session that can be used to cancel all in-flight requests and downloads.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%