git ssb

2+

cel / scuttlebot.io



Tree: 9e4b77aeb7181a93a9ee3ceb1c21d11841a35f57

Files: 9e4b77aeb7181a93a9ee3ceb1c21d11841a35f57 / tmpl / basics / read-the-log.html.js

844 bytesRaw
1var page = require('../page.part')
2var com = require('../com.part')
3
4module.exports = () => page({
5 tab: 'basics',
6 path: '/basics/read-the-log.html',
7 content: `
8 <h2>Read the log</h2>
9 ${ com.code({ js: jsSnippet, bash: bashSnippet }) }
10 <p class="next"><a href="/basics/publish-a-message.html">Publish a message</a></p>
11 <ul class="see-also">
12 <li><a href="/modules/scuttlebot.html"><code>createLogStream()</code> API</a></li>
13 <li><a href="/advanced/advanced-queries.html">Advanced queries</a></li>
14 <li><a href="/advanced/pull-streams.html">Pull streams</a></li>
15 </ul>
16 `
17})
18
19var jsSnippet = `
20var pull = require('pull-stream')
21pull(
22 ssb.createLogStream({ limit: 100 }),
23 pull.collect(err, msgs) {
24 if (err)
25 throw err
26 console.log(msgs)
27 })
28)
29`
30
31var bashSnippet = `
32sbot log --limit 100
33`

Built with git-ssb-web