Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Mar 17, 2024
1 parent 9114472 commit dadc8f8
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,22 @@ Getting started with the DynamoDB Tooling is easy. Just import `dynamoDb` and ge
```js
import { dynamoDb } from 'dynamodb-tooling'

const childProcess = await dynamoDb.launch()
dynamoDb.stop(port)
interface LaunchOptions {
port: number
dbPath?: string
additionalArgs?: string[]
verbose?: boolean
detached?: boolean
javaOpts?: string
}

const childProcess = await dynamoDb.launch(options)
dynamoDb.stopChild(childProcess)
dynamoDb.relaunch()

const port = 8000
dynamoDb.stop(port)

dynamoDb.configureInstaller()
await dynamoDb.install()
```
Expand All @@ -41,16 +53,19 @@ import { dynamoDb } from 'dynamodb-tooling'

const port = 8000;
// if you want to share with Bun Shell
await dynamoDb.launch(port, null, ['-sharedDb'])
// do your tests
dynamoDb.stop(dynamoLocalPort);
await dynamoDb.launch({
port,
additionalArgs: ['-sharedDb'],
})
// do your tests / trigger your logic
dynamoDb.stop(port);
```

Alternatively, you can use it as a detached server:

```ts
const port = 8000
const child = await dynamoDb.launch(port, null, [], false, true)
const child = await dynamoDb.launch({ port })
// trigger your logic
await dynamoDb.stopChild(child)
```
Expand Down

0 comments on commit dadc8f8

Please sign in to comment.