|
1 |
| -# DynamoDB Goodies |
2 |
| - |
3 | 1 | 
|
4 | 2 |
|
| 3 | +# DynamoDB Goodies |
| 4 | + |
5 | 5 | [![npm version][npm-version-src]][npm-version-href]
|
6 | 6 | [![GitHub Actions][github-actions-src]][github-actions-href]
|
7 | 7 | [](http://commitizen.github.io/cz-cli/)
|
|
10 | 10 |
|
11 | 11 | ## Features
|
12 | 12 |
|
13 |
| - -Zero-config DynamoDB setup |
14 |
| - -Local development with SSL support (wip) |
15 |
| - -DynamoDB Toolbox integration |
| 13 | +- Zero-config DynamoDB setup |
| 14 | +- Local development with SSL support (wip) |
| 15 | +- DynamoDB Toolbox integration |
16 | 16 |
|
17 | 17 | ## Install
|
18 | 18 |
|
19 |
| - ```bash |
20 |
| - bun install -d dynamodb-tooling |
21 |
| - ``` |
| 19 | +```bash |
| 20 | +bun install -d dynamodb-tooling |
| 21 | +``` |
22 | 22 |
|
23 | 23 | ## Get Started
|
24 | 24 |
|
25 |
| - Getting started with the DynamoDB Tooling is easy. Just import `dynamoDb` and get going: |
| 25 | +Getting started with the DynamoDB Tooling is easy. Just import `dynamoDb` and get going: |
26 | 26 |
|
27 |
| - ```ts |
28 |
| - import { dynamoDb } from 'dynamodb-tooling' |
| 27 | +```ts |
| 28 | +import { dynamoDb } from 'dynamodb-tooling' |
29 | 29 |
|
30 |
| - interface LaunchOptions { |
31 |
| - port: number |
32 |
| - dbPath?: string |
33 |
| - additionalArgs?: string[] |
34 |
| - verbose?: boolean |
35 |
| - detached?: boolean |
36 |
| - javaOpts?: string |
37 |
| - } |
| 30 | +interface LaunchOptions { |
| 31 | + port: number |
| 32 | + dbPath?: string |
| 33 | + additionalArgs?: string[] |
| 34 | + verbose?: boolean |
| 35 | + detached?: boolean |
| 36 | + javaOpts?: string |
| 37 | +} |
38 | 38 |
|
39 |
| - const childProcess = await dynamoDb.launch(options) |
40 |
| - dynamoDb.stopChild(childProcess) |
41 |
| - dynamoDb.stop(options.port) |
42 |
| - dynamoDb.relaunch() |
| 39 | +const childProcess = await dynamoDb.launch(options) |
| 40 | +dynamoDb.stopChild(childProcess) |
| 41 | +dynamoDb.stop(options.port) |
| 42 | +dynamoDb.relaunch() |
43 | 43 |
|
44 |
| - dynamoDb.configureInstaller() |
| 44 | +dynamoDb.configureInstaller() |
45 | 45 |
|
46 |
| - await dynamoDb.install() |
47 |
| - ``` |
| 46 | +await dynamoDb.install() |
| 47 | +``` |
48 | 48 |
|
49 | 49 | ### Example
|
50 | 50 |
|
51 |
| - ```ts |
52 |
| - import { dynamoDb } from 'dynamodb-tooling' |
53 |
| - |
54 |
| - const port = 8000 |
55 |
| - // if you want to share with Bun Shell |
56 |
| - // eslint-disable-next-line antfu/no-top-level-await |
57 |
| - await dynamoDb.launch({ |
58 |
| - port, |
59 |
| - additionalArgs: ['-sharedDb'], |
60 |
| - }) |
61 |
| - // do your tests / trigger your logic |
62 |
| - dynamoDb.stop(port) |
63 |
| - ``` |
64 |
| - |
65 |
| - Alternatively, you can use it as a detached server: |
66 |
| - |
67 |
| - ```ts |
68 |
| - const port = 8000 |
69 |
| - const child = await dynamoDb.launch({ port }) |
70 |
| - // trigger your logic |
71 |
| - await dynamoDb.stopChild(child) |
72 |
| - ``` |
| 51 | +```ts |
| 52 | +import { dynamoDb } from 'dynamodb-tooling' |
| 53 | + |
| 54 | +const port = 8000 |
| 55 | +// if you want to share with Bun Shell |
| 56 | +// eslint-disable-next-line antfu/no-top-level-await |
| 57 | +await dynamoDb.launch({ |
| 58 | + port, |
| 59 | + additionalArgs: ['-sharedDb'], |
| 60 | +}) |
| 61 | +// do your tests / trigger your logic |
| 62 | +dynamoDb.stop(port) |
| 63 | +``` |
| 64 | + |
| 65 | +Alternatively, you can use it as a detached server: |
| 66 | + |
| 67 | +```ts |
| 68 | +const port = 8000 |
| 69 | +const child = await dynamoDb.launch({ port }) |
| 70 | +// trigger your logic |
| 71 | +await dynamoDb.stopChild(child) |
| 72 | +``` |
73 | 73 |
|
74 | 74 | ## Configuration
|
75 | 75 |
|
76 |
| - The client can be configured using a `dynamodb.config.ts` _(or `dynamodb.config.js`)_ file and it will be automatically loaded. |
| 76 | +The client can be configured using a `dynamodb.config.ts` _(or `dynamodb.config.js`)_ file and it will be automatically loaded. |
77 | 77 |
|
78 |
| - ```ts |
79 |
| - // dynamodb.config.ts (or dynamodb.config.js) |
80 |
| - export default { |
81 |
| - installPath: path.join(os.tmpdir(), 'dynamodb-local'), |
82 |
| - downloadUrl: 'https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz', // the official download URL |
83 |
| - } |
84 |
| - ``` |
| 78 | +```ts |
| 79 | +// dynamodb.config.ts (or dynamodb.config.js) |
| 80 | +export default { |
| 81 | + installPath: path.join(os.tmpdir(), 'dynamodb-local'), |
| 82 | + downloadUrl: 'https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz', // the official download URL |
| 83 | +} |
| 84 | +``` |
85 | 85 |
|
86 | 86 | ## Testing
|
87 | 87 |
|
88 |
| - ```bash |
89 |
| - bun test |
90 |
| - ``` |
| 88 | +```bash |
| 89 | +bun test |
| 90 | +``` |
91 | 91 |
|
92 | 92 | ## Changelog
|
93 | 93 |
|
94 |
| - Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently. |
| 94 | +Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently. |
95 | 95 |
|
96 | 96 | ## Contributing
|
97 | 97 |
|
98 |
| - Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details. |
| 98 | +Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details. |
99 | 99 |
|
100 | 100 | ## Community
|
101 | 101 |
|
102 |
| - For help, discussion about best practices, or any other conversation that would benefit from being searchable: |
| 102 | +For help, discussion about best practices, or any other conversation that would benefit from being searchable: |
103 | 103 |
|
104 |
| - [Discussions on GitHub](https://github.com/stacksjs/stacks/discussions) |
| 104 | +[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions) |
105 | 105 |
|
106 |
| - For casual chit-chat with others using this package: |
| 106 | +For casual chit-chat with others using this package: |
107 | 107 |
|
108 |
| - [Join the Stacks Discord Server](https://discord.gg/stacksjs) |
| 108 | +[Join the Stacks Discord Server](https://discord.gg/stacksjs) |
109 | 109 |
|
110 | 110 | ## Postcardware
|
111 | 111 |
|
112 |
| - Stacks OSS will always stay open-sourced, and we will always love to receive postcards from wherever Stacks is used! _And we also publish them on our website. Thank you, Spatie._ |
| 112 | +Stacks OSS will always stay open-sourced, and we will always love to receive postcards from wherever Stacks is used! _And we also publish them on our website. Thank you, Spatie._ |
113 | 113 |
|
114 |
| - Our address: Stacks.js, 5710 Crescent Park #107, Playa Vista 90094, CA, USA 🌎 |
| 114 | +Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎 |
115 | 115 |
|
116 | 116 | ## Sponsors
|
117 | 117 |
|
118 |
| - We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us. |
| 118 | +We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us. |
119 | 119 |
|
120 |
| - -[JetBrains](https://www.jetbrains.com/) |
121 |
| - -[The Solana Foundation](https://solana.com/) |
| 120 | +- [JetBrains](https://www.jetbrains.com/) |
| 121 | +- [The Solana Foundation](https://solana.com/) |
122 | 122 |
|
123 | 123 | ## Credits
|
124 | 124 |
|
125 |
| - -[dynamodb-toolbox](https://github.com/jeremydaly/dynamodb-toolbox) |
126 |
| - -[dynamodb-local](https://github.com/rynop/dynamodb-local) |
127 |
| - -[Chris Breuer](https://github.com/chrisbbreuer) |
128 |
| - -[All Contributors](../../contributors) |
| 125 | +- [dynamodb-toolbox](https://github.com/jeremydaly/dynamodb-toolbox) |
| 126 | +- [dynamodb-local](https://github.com/rynop/dynamodb-local) |
| 127 | +- [Chris Breuer](https://github.com/chrisbbreuer) |
| 128 | +- [All Contributors](../../contributors) |
129 | 129 |
|
130 | 130 | ## License
|
131 | 131 |
|
132 |
| - The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information. |
| 132 | +The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information. |
133 | 133 |
|
134 |
| - Made with 💙 |
| 134 | +Made with 💙 |
135 | 135 |
|
136 |
| - <!-- Badges --> |
137 |
| - [npm-version-src]: https://img.shields.io/npm/v/bun-reverse-proxy?style=flat-square |
138 |
| - [npm-version-href]: https://npmjs.com/package/bun-reverse-proxy |
139 |
| - [github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/reverse-proxy/ci.yml?style=flat-square&branch=main |
140 |
| - [github-actions-href]: https://github.com/stacksjs/reverse-proxy/actions?query=workflow%3Aci |
| 136 | +<!-- Badges --> |
| 137 | +[npm-version-src]: https://img.shields.io/npm/v/bun-reverse-proxy?style=flat-square |
| 138 | +[npm-version-href]: https://npmjs.com/package/bun-reverse-proxy |
| 139 | +[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/reverse-proxy/ci.yml?style=flat-square&branch=main |
| 140 | +[github-actions-href]: https://github.com/stacksjs/reverse-proxy/actions?query=workflow%3Aci |
141 | 141 |
|
142 |
| - <!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/reverse-proxy/main?style=flat-square |
143 |
| - [codecov-href]: https://codecov.io/gh/stacksjs/reverse-proxy --> |
| 142 | +<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/reverse-proxy/main?style=flat-square |
| 143 | +[codecov-href]: https://codecov.io/gh/stacksjs/reverse-proxy --> |
0 commit comments