@geut/hyperbee-live-stream

Creates a ReadableStream but keep watching for changes in the range defined

Showing:

Popularity

Downloads/wk

36

GitHub Stars

15

Maintenance

Last Commit

2mos ago

Contributors

0

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

hyperbee-live-stream

Creates a ReadableStream but keep watching for changes in the range defined.

Build Status JavaScript Style Guide standard-readme compliant

Made by GEUT

Install

$ npm install @geut/hyperbee-live-stream

Usage

const { HyperbeeLiveStream } = require('@geut/hyperbee-live-stream')

const stream = new HyperbeeLiveStream(db, { gte: 'a', lte: 'b' })
stream.on('data', data => console.log(data))
db.put('a')
db.put('c')
db.put('b')
// will print a, b

API

hyperbeeLiveStream = new HyperbeeLiveStream(db, opts?)

  • db: Hyperbee
  • opts?: any = {}
    • old?: boolean = true Iterate over the old items before start to watching
    • gt?: Buffer | string Only return keys > than this
    • gte?: Buffer | string Only return keys >= than this
    • lt?: Buffer | string Only return keys < than this
    • lte?: Buffer | string Only return keys <= than this
    • reverse?: boolean = false Set to true to get them in reverse order
    • limit?: number = -1 Set to the max number of entries you want

hyperbeeLiveStream.version: number (R)

Returns the last matched version readed

hyperbeeLiveStream.on('synced', version) => void

Emitted when the stream is synced with the last version in the database

  • version: number

Issues

🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT © A GEUT project

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100