You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -243,7 +243,7 @@ guide and API reference for service specific details.
243
243
244
244
**Bare-bones clients/commands**: This refers to a modular way of consuming individual operations on JS SDK clients. It results in less code being imported and thus more performant. It is otherwise equivlent to the aggregated clients/commands.
245
245
246
-
```
246
+
```javascript
247
247
// this imports a bare-bones version of S3 that exposes the .send operation
**Aggregated clients/commands**: This refers to a way of consuming clients that contain all operations on them. Under the hood this calls the bare-bones commands. This imports all commands on a particular client and results in more code being imported and thus less performant. This is 1:1 with v2's style.
259
259
260
-
```
260
+
```javascript
261
261
// this imports an aggregated version of S3 that exposes the .send operation
262
262
import { S3 } from"@aws-sdk/client-s3"
263
263
@@ -298,7 +298,7 @@ An async iterator is much like an iterator, except that its `next()` method retu
298
298
299
299
In v3, the clients expose paginateOperationName APIs that are written using async generators, allowing you to use async iterators in a for await..of loop. You can perform the paginateListTables operation from `@aws-sdk/client-dynamodb` as follows:
300
300
301
-
```
301
+
```javascript
302
302
const {
303
303
DynamoDBClient,
304
304
paginateListTables,
@@ -323,7 +323,7 @@ for await (const page of paginator) {
323
323
324
324
Or simplified:
325
325
326
-
```
326
+
```javascript
327
327
...
328
328
constclient=newDynamoDBClient({});
329
329
@@ -341,7 +341,7 @@ In v3, we support the AbortController interface which allows you to abort reques
341
341
342
342
The [AbortController Interface](https://dom.spec.whatwg.org/#interface-abortcontroller) provides an `abort()` method that toggles the state of a corresponding AbortSignal object. Most APIs accept an AbortSignal object, and respond to `abort()` by rejecting any unsettled promise with an “AbortError”.
343
343
344
-
```
344
+
```javascript
345
345
// Returns a new controller whose signal is set to a newly created AbortSignal object.
346
346
constcontroller=newAbortController();
347
347
@@ -357,7 +357,7 @@ controller.abort();
357
357
358
358
In JavaScript SDK v3, we added an implementation of WHATWG AbortController interface in `@aws-sdk/abort-controller`. To use it, you need to send `AbortController.signal` as `abortSignal` in the httpOptions parameter when calling `.send()` operation on the client as follows:
@@ -385,7 +385,7 @@ For a full pagination deep dive please check out our [blog post](https://aws.ama
385
385
386
386
The following code snippet shows how to upload a file using S3's putObject API in the browser with support to abort the upload. First, create a controller using the `AbortController()` constructor, then grab a reference to its associated AbortSignal object using the AbortController.signal property. When the `PutObjectCommand` is called with `.send()` operation, pass in AbortController.signal as abortSignal in the httpOptions parameter. This will allow you to abort the PutObject operation by calling `abortController.abort()`.
387
387
388
-
```#JavaScript
388
+
```javascript
389
389
constabortController=newAbortController();
390
390
constabortSignal=abortController.signal;
391
391
@@ -425,7 +425,7 @@ A middleware is a higher-order function that transfers user input and/or HTTP re
425
425
426
426
For example, you can use middleware to add a custom header like S3 object metadata:
427
427
428
-
```
428
+
```javascript
429
429
const { S3 } =require("@aws-sdk/client-s3");
430
430
constclient=newS3({ region:"us-west-2" });
431
431
// Middleware added to client, applies to all commands.
@@ -456,7 +456,7 @@ The example above adds middleware to `build` step of middleware stack. The middl
456
456
- The **deserialize** lifecycle step deserializes the raw response object to a structured response. The upstream middleware have access to deserialized data in next callbacks return value: `result.output`.
457
457
Each middleware must be added to a specific step. By default each middleware in the same step has undifferentiated order. In some cases, you might want to execute a middleware before or after another middleware in the same step. You can achieve it by specifying its `priority`.
0 commit comments