Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs-inactive/js-ipfs-http-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 59c84e744dca
Choose a base ref
...
head repository: ipfs-inactive/js-ipfs-http-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0b7ff96017f4
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 21, 2015

  1. Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    9b7e71e View commit details
  2. Copy the full SHA
    76f5d2b View commit details
  3. Merge pull request #130 from Dignifiedquire/log

    feat: Fix log/tail for 0.3.9
    dignifiedquire committed Nov 21, 2015
    Copy the full SHA
    0b7ff96 View commit details
Showing with 14 additions and 6 deletions.
  1. +1 −0 package.json
  2. +5 −1 src/index.js
  3. +8 −5 test/tests.js
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
"merge-stream": "^1.0.0",
"multiaddr": "^1.0.0",
"multipart-stream": "^2.0.0",
"ndjson": "^1.4.3",
"qs": "^6.0.0",
"vinyl": "^1.1.0",
"vinyl-fs-browser": "^2.1.1-1",
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ const multiaddr = require('multiaddr')
const getConfig = require('./config')
const getRequestAPI = require('./request-api')
const Wreck = require('wreck')
const ndjson = require('ndjson')

exports = module.exports = IpfsAPI

@@ -203,7 +204,10 @@ function IpfsAPI (host_or_multiaddr, port) {

self.log = {
tail (cb) {
return requestAPI('log/tail', null, {enc: 'text'}, null, true, cb)
requestAPI('log/tail', null, {}, null, false, (err, res) => {
if (err) return cb(err)
cb(null, res.pipe(ndjson.parse()))
})
}
}

13 changes: 8 additions & 5 deletions test/tests.js
Original file line number Diff line number Diff line change
@@ -619,15 +619,18 @@ describe('IPFS Node.js API wrapper tests', () => {
})

describe('.log', function () {
// TODO news 0.3.9 ndjson stuff
it.skip('.log.tail', function (done) {
it('.log.tail', function (done) {
this.timeout(20000)

apiClients['a'].log.tail((err, res) => {
if (err) {
throw err
}

console.log('->', res)
done()
res.once('data', obj => {
assert(obj)
assert.equal(typeof obj, 'object')
done()
})
})
})
})