npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@asn.aeb/dynamodb-local

v0.0.3

Published

Use DynamoDB locally from Node.js or CLI

Downloads

12

Readme

DynamoDBLocal

Install and run AWS DynamoDB locally via CLI or Javascript API.

NOTE: To run DynamoDB on your computer, you must have the Java Runtime Environment (JRE) version 8.x or newer installed. The application doesn't run on earlier JRE versions.

Installation

npm i @asn.aeb/dybamodb-local

or, to install globally

npm i -g @asn.aeb/dybamodb-local

CLI

The CLI API can be used via npx dynamodb-local when installed locally or by just calling dynamodb-local from your shell when installed with -g

install

Downloads and installs dynamodb or, if already installed, prompts to download the latest version and update the current installation.

dynamodb-local install 

uninstall

Uninstalls dynamodb.

dynamodb-local uninstall 

start

Starts dynamodb or, if not installed, prompts to install it and, on positive response, will install and then immediately start the service.

dynamodb-local start

The command can take the following arguments:

--cors

An allow list of specific domains separated by comma. Defaults to *

dynamodb-local start --cors=my.domain.com,my-other-domain.com

---dbPath

The directory where DynamoDB writes its database file. Defaults to {install dir}/DynamoDBLocal_db. Cannot be used along with --inMemory.

dynamodb-local start --dbPath=path/to/directory

--delayTransientStatuses

Causes DynamoDB to introduce delays for certain operations, simulating the behavior of the DynamoDB web service more closely.

dynamodb-local start --delayTransientStatuses

--inMemory

DynamoDB runs in memory instead of using a database file. Cannot be used along with --dbPath.

dynamodb-local start --inMemory

--port

The port number that dynamodb uses. Defaults to 8000

dynamodb-local start --port=3000

--sharedDb

DynamoDB uses a single database file instead of separate files for each credential and Region.

dynamodb-local --sharedDb

For more info about these options, see the aws documentation

The --path argument

All CLI commands can take the --path argument which indicates to run that command relative to a custom path where a dynamodb installation resides. Most of the times you won't need this. When omitted, the default install location will be used: {package root}/node_modules/@asn.aeb/dynamodb-local/dynamodb.

dynamodb-local install --path=path/to/directory
dynamodb-local uninstall --path=path/to/directory
dynamodb-local start --path=path/to/directory

Javascript

The Javascript API can be run from Node >= 14. The package exports a single class called DynamoDBLocal and the DynamoDBOptions interface for Typescript.

DynamoDBLocal

To use the default install location (recommended), You won't need to instantiate the class, just use its static methods. The methods return promises and may prompt to the console. If the returned promises reject, errors are automatically printed to the console so you don't need to catch (error) {console.log(error)}

import {DynamoDBLocal} from '@asn.aeb/dynamodb-local'

await DynamoDBLocal.install()
await DynamoDBLocal.start()
await DynamoDBLocal.stop()
await DynamoDBLocal.uninstall()

If you want to use a custom install location, You'll need to instantiate the class, passing your path to the constructor.

import {DynamoDBLocal} from '@asn.aeb/dynamodb-local'

const dynamodbLocal = new DynamoDBLocal('path/to/directory')
await dynamodbLocal.install()
await dynamodbLocal.start()
await dynamodbLocal.stop()
await dynamodbLocal.uninstall()

install

Same as calling dynamodb-local install. Returns a promise that resolves to void when the installation is complete or rejects if there is some error.

Example

import {DynamoDBLocal} from '@asn.aeb/dynamodb-local'

try {
    await DynamoDBLocal.install()

    // OR

    const ddb = new DynamoDBLocal('path/to/dir')
    await ddb.install()
}

catch {}

uninstall

Same as calling dynamodb-local uninstall. Returns a promise that resolves to void when the uninstallation is complete or rejects if there is some error.

Example

import {DynamoDBLocal} from '@asn.aeb/dynamodb-local'

try {
    await DynamoDBLocal.uninstall()

    // OR

    const ddb = new DynamoDBLocal('path/to/dir')
    await ddb.uninstall()
}

catch {}

start

Same as calling dynamodb-local start. Returns a promise that resolves to void when dynamodb has started or rejects if there is some error. Optionally, takes an object as the only argument with the following shape:

interface DynamoDBOptions {
    cors?: string[]
    dbPath?: string
    delayTransientStatuses?: boolean
    inMemory?: boolean
    port?: number
    sharedDB?: boolean
} 

For info about these options, see above.

Example

import {DynamoDBLocal} from '@asn.aeb/dynamodb-local'

try {
    await DynamoDBLocal.start({inMemory: true, port: 3000})

    // OR

    const ddb = new DynamoDBLocal('path/to/dir')
    await ddb.start({cors: ['my.domain.com', 'my-other-domain.com']})
}

catch {}

stop

Terminate the dynamodb process if it is still executing. You don't need to call this before exiting the main Node.js process, it will automatically terminate. If multiple dynamodb processes are running, only the one associated with the instance on which stop is called will be terminated.

Example

import {DynamoDBLocal} from '@asn.aeb/dynamodb-local'

try {
    await DynamoDBLocal.start()
    // ..do your stuff
    await DynamoDBLocal.stop()

    // OR

    const ddb_0 = new DynamoDBLocal('path/to/dir')
    const ddb_1 = new DynamoDBLocal('path/to/another/dir')
    
    await ddb_0.start({port: 3000})
    await ddb_1.start({port: 3001})
    // ..do your stuff
    await ddb_0.stop()
    // ddb_1 is still running
    await ddb_1.stop()
    // ddb_1 is stopped as well
}

catch {}