lls

levelgraph-live-stream

Live stream a levelgraph query

Showing:

Popularity

Downloads/wk

4

GitHub Stars

0

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

10

Size (min+gzip)

15.9KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

levelgraph live stream

Live stream a levelgraph query.

install

$ npm install levelgraph-live-stream

example

var db = require('level-test')()('testdb');
var graphdb = require('levelgraph')(db);
var livefeed = require('levelgraph-live-stream');
var through = require('through2');

livefeed(db, { predicate: 'mythology' }, { old: false })
  .pipe(through.obj((data, enc, cb) => {
    cb(null, JSON.stringify(data, null, 2));
  }))
  .pipe(process.stdout)
;

graphdb.put({ subject: 'sphinx', predicate: 'mythology', object: 'greek' });
graphdb.put({ subject: 'loki', predicate: 'mythology', object: 'norse' });

API

livefeed(leveldb, triple, [opts]) => readable stream

Pass in the level or sublevel instance used by levelgraph and a triple. The opts arg is passed to level-live-stream. Return a readable stream that emits objects.

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