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

Update examples to explicitly use BufferListStream. #78

Merged
merged 2 commits into from
Oct 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ hyperquest(url).pipe(BufferListStream((err, data) => {
Or, use it as a readable stream to recompose a list of Buffers to an output source:

```js
const { BufferList } = require('bl')
const { BufferListStream } = require('bl')
const fs = require('fs')

var bl = new BufferList()
var bl = new BufferListStream()
bl.append(Buffer.from('abcd'))
bl.append(Buffer.from('efg'))
bl.append(Buffer.from('hi'))
Expand Down Expand Up @@ -171,7 +171,7 @@ No copies will be performed. All buffers in the result share memory with the ori
`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:

```js
var bl = new BufferList()
var bl = new BufferListStream()

bl.append('hello')
bl.append(' world')
Expand Down