Files: 1b92defc7a364a894997eabdeefb6b94f0c1230b / 2_read_from_flume.js
430 bytesRaw
1 | const Flume = require('flumedb') |
2 | const FlumeLog = require('flumelog-offset') |
3 | const codec = require('flumecodec') |
4 | const FlumeView = require('flumeview-reduce') |
5 | |
6 | const pull = require('pull-stream') |
7 | |
8 | const log = FlumeLog('demo_log', { codec: codec.json }) |
9 | const db = Flume(log) |
10 | |
11 | db.get(62, console.log) |
12 | |
13 | pull( |
14 | db.stream(), // source |
15 | pull.map(msg => msg.value.message), |
16 | pull.drain(msg => { // sink |
17 | console.log(msg) |
18 | }) |
19 | ) |
20 | |
21 | |
22 |
Built with git-ssb-web