Code Monkey home page Code Monkey logo

dynamo-db-local's Introduction

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

dynamo-db-local's People

Contributors

chrisguttandin avatar greenkeeperio-bot avatar greenkeeper[bot] avatar fishcharlie avatar shadowblazen avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.