Skip to content
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
@tinybike

Description

@tinybike

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions