Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aws/aws-sdk-js-codemod
Codemod scripts to update AWS SDK for JavaScript APIs.
https://github.com/aws/aws-sdk-js-codemod
ast aws aws-sdk aws-sdk-js javascript jscodeshift jscodeshift-codemod nodejs recast
Last synced: 7 days ago
JSON representation
Codemod scripts to update AWS SDK for JavaScript APIs.
- Host: GitHub
- URL: https://github.com/aws/aws-sdk-js-codemod
- Owner: aws
- License: mit-0
- Created: 2022-02-28T22:25:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-08T06:27:31.000Z (6 months ago)
- Last Synced: 2024-05-21T13:55:24.343Z (6 months ago)
- Topics: ast, aws, aws-sdk, aws-sdk-js, javascript, jscodeshift, jscodeshift-codemod, nodejs, recast
- Language: TypeScript
- Homepage:
- Size: 9.95 MB
- Stars: 63
- Watchers: 4
- Forks: 8
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
- awesome-codemods - aws-sdk-js-codemod - Codemod scripts to update AWS SDK for JavaScript APIs. (JavaScript)
README
# aws-sdk-js-codemod
This repository contains a collection of codemod scripts for use with
[JSCodeshift][jscodeshift] that help update [AWS SDK for JavaScript][aws-sdk-js]
APIs.The `aws-sdk-js-codemod` CLI is a lightweight wrapper over jscodeshift.
It processes `--help`, `--version` and `--transform` options before passing them
downstream.You can provide names of the custom transforms instead of a local path or url:
v2-to-v3 Converts AWS SDK for JavaScript APIs in a Javascript/TypeScript
codebase from version 2 (v2) to version 3 (v3).Please review the code change thoroughly for required functionality before deploying it to production.
If the transformation is not complete or is incorrect, please report the issue on GitHub.## Prerequisites
To use aws-sdk-js-codemod, please install [Node.js][install-nodejs].
## Usage
- Optionally execute dry-run for the transform, and print transformed files on stdout:
```console
npx aws-sdk-js-codemod@latest --dry --print -t v2-to-v3 PATH...
```
- Run transform, and make changes to files:
```console
npx aws-sdk-js-codemod@latest -t v2-to-v3 PATH...
```## Example
```console
$ cat example.ts
import AWS from "aws-sdk";
const client = new AWS.DynamoDB();
const response = await client.listTables({}).promise();$ npx aws-sdk-js-codemod@latest -t v2-to-v3 example.ts
$ cat example.ts
import { DynamoDB } from "@aws-sdk/client-dynamodb";
const client = new DynamoDB();
const response = await client.listTables({});
```For a summary of supported transformations, check [TRANSFORMATIONS.md](TRANSFORMATIONS.md).
## License
This library is licensed under the MIT-0 License. See the LICENSE file.
[aws-sdk-js]: https://aws.amazon.com/sdk-for-javascript/
[install-nodejs]: https://nodejs.dev/learn/how-to-install-nodejs
[jscodeshift]: https://github.com/facebook/jscodeshift