Files: 95a067249e90995c9d34e46ae4aa937180c1d2f6 / test / git-remote-test.js
839 bytesRaw
1 | |
2 | |
3 | var toPull = require('stream-to-pull-stream') |
4 | var pull = require('pull-stream') |
5 | |
6 | pull( |
7 | toPull(process.stdin), |
8 | require('../')({ |
9 | prefix: 'foo', |
10 | objectSink: function (readObject) { |
11 | readObject(null, function next(end, type, read) { |
12 | if (end === true) return |
13 | if (end) throw end |
14 | console.error('got object of type', type) |
15 | pull( |
16 | read, |
17 | pull.collect(function (err, bufs) { |
18 | if (err) throw err |
19 | var data = Buffer.concat(bufs).toString('ascii') |
20 | console.error('object', data.length, data) |
21 | readObject(null, next) |
22 | }) |
23 | ) |
24 | }) |
25 | }, |
26 | refSink: pull.drain(function (ref) { |
27 | console.error('ref', ref) |
28 | }), |
29 | }), |
30 | toPull(process.stdout, function (err) { |
31 | if (err) |
32 | throw err |
33 | }) |
34 | ) |
35 |
Built with git-ssb-web