|
1 |
| -<p align="center"><img src=".github/art/cover.png" alt="Social Card of this repo"></p> |
| 1 | +# DynamoDB Goodies |
| 2 | + |
| 3 | + |
2 | 4 |
|
3 | 5 | [![npm version][npm-version-src]][npm-version-href]
|
4 | 6 | [![GitHub Actions][github-actions-src]][github-actions-href]
|
5 | 7 | [](http://commitizen.github.io/cz-cli/)
|
6 | 8 | <!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
|
7 | 9 | <!-- [![Codecov][codecov-src]][codecov-href] -->
|
8 | 10 |
|
9 |
| -# DynamoDB Goodies |
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() |
45 |
| -await dynamoDb.install() |
46 |
| -``` |
| 44 | + dynamoDb.configureInstaller() |
47 | 45 |
|
48 |
| -### Example |
49 |
| - |
50 |
| -```ts |
51 |
| -import { dynamoDb } from 'dynamodb-tooling' |
| 46 | + await dynamoDb.install() |
| 47 | + ``` |
52 | 48 |
|
53 |
| -const port = 8000 |
54 |
| -// if you want to share with Bun Shell |
55 |
| -await dynamoDb.launch({ |
56 |
| - port, |
57 |
| - additionalArgs: ['-sharedDb'], |
58 |
| -}) |
59 |
| -// do your tests / trigger your logic |
60 |
| -dynamoDb.stop(port) |
61 |
| -``` |
62 |
| - |
63 |
| -Alternatively, you can use it as a detached server: |
| 49 | +### Example |
64 | 50 |
|
65 |
| -```ts |
66 |
| -const port = 8000 |
67 |
| -const child = await dynamoDb.launch({ port }) |
68 |
| -// trigger your logic |
69 |
| -await dynamoDb.stopChild(child) |
70 |
| -``` |
| 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 | + ``` |
71 | 73 |
|
72 | 74 | ## Configuration
|
73 | 75 |
|
74 |
| -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. |
75 | 77 |
|
76 |
| -```ts |
77 |
| -// dynamodb.config.ts (or dynamodb.config.js) |
78 |
| -export default { |
79 |
| - installPath: path.join(os.tmpdir(), 'dynamodb-local'), |
80 |
| - downloadUrl: 'https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz', // the official download URL |
81 |
| -} |
82 |
| -``` |
| 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 | + ``` |
83 | 85 |
|
84 | 86 | ## Testing
|
85 | 87 |
|
86 |
| -```bash |
87 |
| -bun test |
88 |
| -``` |
| 88 | + ```bash |
| 89 | + bun test |
| 90 | + ``` |
89 | 91 |
|
90 | 92 | ## Changelog
|
91 | 93 |
|
92 |
| -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. |
93 | 95 |
|
94 | 96 | ## Contributing
|
95 | 97 |
|
96 |
| -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. |
97 | 99 |
|
98 | 100 | ## Community
|
99 | 101 |
|
100 |
| -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: |
101 | 103 |
|
102 |
| -[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions) |
| 104 | + [Discussions on GitHub](https://github.com/stacksjs/stacks/discussions) |
103 | 105 |
|
104 |
| -For casual chit-chat with others using this package: |
| 106 | + For casual chit-chat with others using this package: |
105 | 107 |
|
106 |
| -[Join the Stacks Discord Server](https://discord.gg/stacksjs) |
| 108 | + [Join the Stacks Discord Server](https://discord.gg/stacksjs) |
107 | 109 |
|
108 | 110 | ## Postcardware
|
109 | 111 |
|
110 |
| -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._ |
111 | 113 |
|
112 |
| -Our address: Stacks.js, 5710 Crescent Park #107, Playa Vista 90094, CA, USA 🌎 |
| 114 | + Our address: Stacks.js, 5710 Crescent Park #107, Playa Vista 90094, CA, USA 🌎 |
113 | 115 |
|
114 | 116 | ## Sponsors
|
115 | 117 |
|
116 |
| -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. |
117 | 119 |
|
118 |
| -- [JetBrains](https://www.jetbrains.com/) |
119 |
| -- [The Solana Foundation](https://solana.com/) |
| 120 | + -[JetBrains](https://www.jetbrains.com/) |
| 121 | + -[The Solana Foundation](https://solana.com/) |
120 | 122 |
|
121 | 123 | ## Credits
|
122 | 124 |
|
123 |
| -- [dynamodb-toolbox](https://github.com/jeremydaly/dynamodb-toolbox) |
124 |
| -- [dynamodb-local](https://github.com/rynop/dynamodb-local) |
125 |
| -- [Chris Breuer](https://github.com/chrisbbreuer) |
126 |
| -- [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) |
127 | 129 |
|
128 | 130 | ## License
|
129 | 131 |
|
130 |
| -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. |
131 | 133 |
|
132 |
| -Made with 💙 |
| 134 | + Made with 💙 |
133 | 135 |
|
134 |
| -<!-- Badges --> |
135 |
| -[npm-version-src]: https://img.shields.io/npm/v/bun-reverse-proxy?style=flat-square |
136 |
| -[npm-version-href]: https://npmjs.com/package/bun-reverse-proxy |
137 |
| -[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/reverse-proxy/ci.yml?style=flat-square&branch=main |
138 |
| -[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 |
139 | 141 |
|
140 |
| -<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/reverse-proxy/main?style=flat-square |
141 |
| -[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