Skip to content
A wrapper around Amazon's DynamoDB Local to start and stop it from Node.js.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib/dynamodb_local_2019-02-04
src
test
.gitignore
.travis.yml
LICENSE
README.md
gruntfile.js
package-lock.json
package.json

README.md

dynamo-db-local

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

tests dependencies version

This module wraps Amazon's DynamoDB Local. It just exposes one method called spawn() which does not much more than calling child_process.spawn() and returning it's result.

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

The spawn() function accecpts an optional options object which can have an optional path. 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();

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();

Finally the options object could have a sharedDb property. If true, DynamoDB 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();
You can’t perform that action at this time.