File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 1
- import { loadConfig } from 'c12'
2
1
import type { Config } from './types'
2
+ import { loadConfig } from 'c12'
3
+
4
+ // Define an async function to load the config
5
+ async function loadDynamoDBConfig ( ) {
6
+ const { config } = await loadConfig ( {
7
+ name : 'dynamodb' ,
8
+ defaultConfig : {
9
+ port : 8000 ,
10
+ dbPath : '' ,
11
+ detached : false ,
12
+ additionalArgs : [ '-sharedDb' ] ,
13
+ javaOpts : '' ,
14
+ installPath : 'dynamodb-local' ,
15
+ downloadUrl : 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz' ,
16
+ } ,
17
+ } ) as { config : Config }
3
18
4
- // Get loaded config
5
- const { config } = await loadConfig ( {
6
- name : 'dynamodb' ,
7
- defaultConfig : {
8
- port : 8000 ,
9
- dbPath : '' ,
10
- detached : false ,
11
- additionalArgs : [ '-sharedDb' ] ,
12
- javaOpts : '' ,
13
- installPath : 'dynamodb-local' ,
14
- downloadUrl : 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz' ,
15
- } ,
16
- } ) as { config : Config }
19
+ return config
20
+ }
17
21
18
- export { config }
22
+ // Export the config (wrapped in a promise)
23
+ export const config = loadDynamoDBConfig ( )
Original file line number Diff line number Diff line change 1
- export { Table , Entity } from 'dynamodb-toolbox'
1
+ export { Entity , Table } from 'dynamodb-toolbox'
Original file line number Diff line number Diff line change 1
- import { promisify } from 'node:util'
2
1
import * as fs from 'node:fs'
2
+ import { promisify } from 'node:util'
3
3
4
4
export async function exists ( path : string ) : Promise < boolean > {
5
5
const access = promisify ( fs . access )
You can’t perform that action at this time.
0 commit comments