Comparing version 2.0.3 to 2.0.4
10
index.js
@@ -12,3 +12,3 @@ var raf = require('random-access-file') | ||
PROTOCOL_VERSION = '1.0.0' | ||
var PROTOCOL_VERSION = '1.0.0' | ||
@@ -297,9 +297,3 @@ module.exports = Multifeed | ||
debug('[SERIALIZE] json buf to read: ' + jsonBuf.toString()) | ||
try { | ||
var header = JSON.parse(jsonBuf.toString('utf8')) | ||
return header | ||
return header | ||
} catch (e) { | ||
return new Error('failed to parse header') | ||
} | ||
return JSON.parse(jsonBuf.toString('utf8')) | ||
} | ||
@@ -306,0 +300,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Stephen Whitmore <sww@eight.net>", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "git://github.com/noffle/multifeed.git" |
@@ -22,3 +22,3 @@ # multifeed | ||
// create as many writeable feeds as you want; returns hypercores | ||
multi.writer(function (err, w) { | ||
multi.writer('local', function (err, w) { | ||
console.log(w.key, w.writeable, w.readable) // => Buffer <0x..> true true | ||
@@ -29,4 +29,4 @@ console.log(multi.feeds().length) // => 1 | ||
w.append('foo', function () { | ||
var m2 = multifeed(ram, { valueEncoding: 'json' }) | ||
m2.writer(function (err, w2) { | ||
var m2 = multifeed(hypercore, ram, { valueEncoding: 'json' }) | ||
m2.writer('local', function (err, w2) { | ||
w2.append('bar', function () { | ||
@@ -33,0 +33,0 @@ replicate(multi, m2, function () { |
Sorry, the diff of this file is not supported yet
24979
655