Skip to content

Commit 2316bec

Browse files
committed
docs: add explicit Buffer import in bytes() examples
1 parent 79491e0 commit 2316bec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/webstreams.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,7 @@ added: v25.0.0
17071707
```mjs
17081708
import { bytes } from 'node:stream/consumers';
17091709
import { Readable } from 'node:stream';
1710+
import { Buffer } from 'node:buffer';
17101711

17111712
const dataBuffer = Buffer.from('hello world from consumers!');
17121713

@@ -1719,6 +1720,7 @@ console.log(`from readable: ${data.length}`);
17191720
```cjs
17201721
const { bytes } = require('node:stream/consumers');
17211722
const { Readable } = require('node:stream');
1723+
const { Buffer } = require('node:buffer');
17221724

17231725
const dataBuffer = Buffer.from('hello world from consumers!');
17241726

0 commit comments

Comments
 (0)