Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file.getBuffer() API #230

Merged
merged 4 commits into from Jan 4, 2015
Merged

Add file.getBuffer() API #230

merged 4 commits into from Jan 4, 2015

Conversation

@feross
Copy link
Member

feross commented Jan 4, 2015

New convenience API:

file.getBuffer(function callback (err, url) {})

Get the file contents as a Buffer.

The file will be fetched from the network with highest priority, and callback will be
called once the file is ready. callback must be specified, and will be called with a an
Error (or null) and the file contents as a Buffer.

file.getBuffer(function (err, buffer) {
  if (err) throw err
  console.log(buffer) // <Buffer 00 98 00 01 01 00 00 00 50 ae 07 04 01 00 00 00 0a 00 00 00 00 00 00 00 78 ae 07 04 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...>
})
feross added a commit that referenced this pull request Jan 4, 2015
Add file.getBuffer() API
@feross feross merged commit f2a79a7 into master Jan 4, 2015
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@feross

This comment has been minimized.

Copy link
Member Author

feross commented Jan 4, 2015

Released as 0.21.0.

@feross feross deleted the get-buffer branch Jan 22, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.