Skip to content

Commit 68341cc

Browse files
authored
Add a simpler concise example in README (#677)
1 parent 8268f6c commit 68341cc

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

.changeset/strange-rings-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Add a simpler concise example in README

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,15 @@ To use aws-sdk-js-codemod, please install [Node.js][install-nodejs].
3333
```console
3434
$ cat example.ts
3535
import AWS from "aws-sdk";
36-
37-
const region = "us-west-2";
38-
const client = new AWS.DynamoDB({ region });
39-
client.listTables({}, (err, data) => {
40-
if (err) console.log(err, err.stack);
41-
else console.log(data);
42-
});
36+
const client = new AWS.DynamoDB();
37+
const response = await client.listTables({}).promise();
4338

4439
$ npx aws-sdk-js-codemod@latest -t v2-to-v3 example.ts
4540

4641
$ cat example.ts
4742
import { DynamoDB } from "@aws-sdk/client-dynamodb";
48-
49-
const region = "us-west-2";
50-
const client = new DynamoDB({ region });
51-
client.listTables({}, (err, data) => {
52-
if (err) console.log(err, err.stack);
53-
else console.log(data);
54-
});
43+
const client = new DynamoDB();
44+
const response = await client.listTables({});
5545

5646
```
5747

0 commit comments

Comments
 (0)