This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
add (with recursive: true) returns improperly-formatted JSON #82
Closed
Description
The add
method (with recursive: true
) isn't returning properly-formatted JSON for me. Instead I get a string that almost looks like JSON, but isn't actually, so to parse it I have to do some string mangling. Example:
var ipfs = require("ipfs-api")("localhost", "5001");
ipfs.add("./ipfs", {recursive: true}, function (err, res) {
if (err || !res) return console.error(err);
console.log(res);
});
This prints out:
{
"Name": "funcrusher.json",
"Hash": "QmUSpeNRKrYHRG55WvYTi5u3VVHaP3uHtH1mDKCB9Qa9AJ"
}{
"Name": "ipfs",
"Hash": "QmYuDw2SxfWkFasmmenzsdKSV7QVHAEuevAuCjcDh8kEYt"
}{
"Name": "",
"Hash": "QmWike1KhJRzY4EMtreidZDgq1EhYpLY444pfVJxxD3wSp"
}
(Note the lack of commas between the objects, and lack of enclosing array brackets.)