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.

API Proposal: refactor file adding #279

Closed
@hackergrrl

Description

@hackergrrl

Background

We're in the process of unifying the js-ipfs and js-ipfs-api APIs to be consistent, provided by the interface-ipfs-core interface. For the roadmap, see this issue.

Part of this process is identifying what API calls from js-ipfs-api should be part of the IPFS Core API, and which are auxiliary functions that aren't specific to the core.

Proposed Change

One such API call from js-ipfs-api that doesn't fit well into Core is the ability to add a file or directory using add. Core needs to be as agnostic as possible, and shouldn't be responsible for interacting with the underlying file system at all (think browser support).

This is useful functionality to have though, so I suggest moving the file/directory adding logic into a separate method on the API, like addFiles, which can perform the filesystem operations within this module, and translate them to an array of streams and paths to be handed over to the Core API.

Steps

  • remove file/directory adding from add
  • introduce a new api call that does adding files from the local filesystem (addFiles)
  • remove url adding from add
  • introduce a new api call that does adding files from a URL (addURL)
  • use interface-ipfs-core for testing add
  • bump a major semver to make it clear that this is a breaking change

ping @diasdavid @nginnever @dignifiedquire

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