Skip to content

Commit

Permalink
docs: replace defunct @aws-sdk/util-stream-node module with its suc…
Browse files Browse the repository at this point in the history
…cessor (#184)
  • Loading branch information
marcusleg authored Dec 31, 2023
1 parent 7ccfdca commit 6a74c16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,12 @@ s3Mock.on(UploadPartCommand).rejects();
#### S3 GetObjectCommand

AWS SDK wraps the stream in the S3 `GetObjectCommand` result to provide utility methods to parse it.
To mock it, you need to call the wrapping function `sdkStreamMixin()` on the stream you provide as the command output:
To mock it, you need to install the [`@smithy/util-stream`](https://www.npmjs.com/package/@smithy/util-stream) package
and call the wrapping function `sdkStreamMixin()` on the stream you provide as the command output:

```ts
import {GetObjectCommand, S3Client} from '@aws-sdk/client-s3';
import {sdkStreamMixin} from '@aws-sdk/util-stream-node';
import {sdkStreamMixin} from '@smithy/util-stream';
import {mockClient} from 'aws-sdk-client-mock';
import {Readable} from 'stream';
import {createReadStream} from 'fs';
Expand Down

0 comments on commit 6a74c16

Please sign in to comment.