9.1.1 • Published 5 days ago

dynamo-db-local v9.1.1

Weekly downloads
255
License
MIT
Repository
github
Last release
5 days ago

dynamo-db-local

A wrapper around Amazon's DynamoDB Local to start and stop it from Node.js.

version

This module wraps Amazon's DynamoDB Local. It exposes one method called spawn() which calls child_process.spawn() internally and returns its result.

const dynamoDbLocalProcess = dynamoDbLocal.spawn();
// ...
dynamoDbLocalProcess.kill();

Configuration

The spawn() function accecpts an optional options object.

command

The command property of that object can be used to run DynamoDB Local with Docker instead of using the bundled Java version.

const command = 'docker';
const dynamoDbLocalProcess = dynamoDbLocal.spawn({ command });
// ...
dynamoDbLocalProcess.kill();

detached

In a CI/CD environment you might want to let DynamoDB Local to run in the background. In this case, you should use the detached property.

const dynamoDbLocalProcess = dynamoDbLocal.spawn({ detached: true, stdio: 'ignore' });
// ...
dynamoDbLocalProcess.unref();

name

A custom name may be used to indentify the Docker container by name.

const dynamoDbLocalProcess = dynamoDbLocal.spawn({ command: 'docker', name: 'a-unique-name' });
// ...
dynamoDbLocalProcess.kill();

path

The options object can also be used to set an optional path property. If set, that path will be used to store the database file. If no path is specified the database will be kept in memory.

const path = 'somewhere/on/your/disk';
const dynamoDbLocalProcess = dynamoDbLocal.spawn({ path });
// ...
dynamoDbLocalProcess.kill();

port

Another property the options object could have is port. It specifies the port number that the process will run on. In absence of the port property, 8000 is used as the port number.

const port = 8001;
const dynamoDbLocalProcess = dynamoDbLocal.spawn({ port });
// ...
dynamoDbLocalProcess.kill();

sharedDb

The options object could also have a sharedDb property. If true, DynamoDB Local will use a single database file, instead of using separate files for each credential and region. The default of this option is false.

const dynamoDbLocalProcess = dynamoDbLocal.spawn({ sharedDb: true });
// ...
dynamoDbLocalProcess.kill();

stdio

Finally the options object can also be used to specify a custom stdio configuration.

const dynamoDbLocalProcess = dynamoDbLocal.spawn({ stdio: 'inherit' });
// ...
dynamoDbLocalProcess.kill();
9.1.1

5 days ago

9.1.0

21 days ago

9.0.0

24 days ago

8.1.1

1 month ago

8.1.0

2 months ago

8.0.0

3 months ago

7.3.0

4 months ago

7.2.0

5 months ago

7.1.0

6 months ago

6.1.0

9 months ago

7.0.0

9 months ago

6.0.0

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.1.4

1 year ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.3

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

4.1.0

2 years ago

4.0.3

2 years ago

4.0.2

3 years ago

3.2.7

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.2.6

3 years ago

3.2.5

3 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.1

5 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago