Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Update with example outputting the content to stdout #237

Merged
merged 1 commit into from
Mar 14, 2018

Conversation

kevinsimper
Copy link
Contributor

@kevinsimper kevinsimper commented Mar 14, 2018

I am updating with a example that does what the comment says write the file's path and contents to standard out. It takes the getting started docs and outputs them to the console.

https://ipfs.io/docs/getting-started/

https://jsbin.com/niwadeceze/1/edit?js,output

Closing #226

file.content.on('data', (data) => {
console.log(data.toString())
})
file.content.resume()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it require the resume call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I tried without and it did not work. You can see the proof in the jsbin link :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinsimper thanks for checking. I've seen this in the past too. Let's keep it in the docs then :)

@daviddias daviddias merged commit 40d8c78 into ipfs-inactive:master Mar 14, 2018
@kevinsimper kevinsimper deleted the patch-2 branch March 17, 2018 16:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants