Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Update files.add return format to match js-ipfs-api #247

Closed
@hackergrrl

Description

@hackergrrl

The current result format in js-ipfs core is

{
  path: 'the original path',
  size: (# of bytes of the data),
  dataSize: (moar!)
  multihash: (a Buffer of the data multihash)
}

as dictated by unixfs-engine. This is different from what the HTTP API returns, which is a lot less information:

{
  Name: 'some name',
  Hash: 'QmRNjDeKStKGTQXnJ2NFqeQ9oW23WcpbmvCVrpDHgDg3T6'
}

To make interface-ipfs-core consistent, I propose we either

  1. Modify unixfs-engine to return objects of the latter format, or
  2. Modify js-ipfs to massage its results from unixfs-engine into the latter format

I prefer (2) personally, since it means other modules can still use unixfs-engine to get a fuller set of data from whatever is imported.


ping @diasdavid @nginnever

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions