Giter Club home page Giter Club logo

hyperbee-live-stream's Introduction

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

hyperbee-live-stream's People

Contributors

tinchoz49 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

lifeorg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.