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

feat: expose Buffer on the dist version #523

Closed
interfect opened this issue Oct 17, 2016 · 2 comments
Closed

feat: expose Buffer on the dist version #523

interfect opened this issue Oct 17, 2016 · 2 comments

Comments

@interfect
Copy link

According to the API spec, you're supposed to pass a node Buffer, a node Readable stream, or an object containing one of those to the ipfs.files.add method. However, this project advertises the ability to use the implementation by including a <script> tag:

<script src="https://unpkg.com/ipfs/dist/index.min.js"></script>

If you do include that tag, you get a global Ipfs object, and you can indeed start up a node and go online. But since in the global namespace there is no Buffer or Readable stream implementation, what are you supposed to pass to ipfs.files.add? It would seem to be requiring types that can't be created outside it's fancy webpack module that hides all the node globals.

@daviddias
Copy link
Member

daviddias commented Oct 17, 2016

@interfect fair point. Would you like to submit a PR that exposes Buffer under ipfs.Buffer, so that it doesn't force users to bundle Buffer as a separate blob? This will need to be documented.

@daviddias daviddias changed the title API doesn't make sense in the browser feat: expose Buffer on the dist version Oct 17, 2016
@daviddias
Copy link
Member

since it is being handled here: #525
closing this issue :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants