Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
aws-dynamodb-local
Advanced tools
Note This is a continuation of and drop-in replacement for
dynamodb-localhost
(for more info, see migrating from dynamodb-localhost)
This library works as a wrapper for AWS DynamoDB Local, intended for use in development and testing.
Features:
port
, inMemory
, sharedDb
.Are you using serverless-offline? You might be interested in serverless-offline-dynamodb.
Requires:
npm install aws-dynamodb-local
Usage example
import dynamodbLocal from "aws-dynamodb-local"
await dynamodbLocal.install();
await dynamodbLocal.start({ port: 8000 });
Supported methods
// Ensure DynamoDB Local is installed.
// The first time, this will download from AWS and extract files to disk.
install(options)
// Start an instance of DynamoDB Local.
// DynamoDB will then process incoming requests until you stop it.
// The optional `options` object is documented below.
start(options)
// Stops the instance of DynamoDb Local running on an specified port.
stop(port)
// Uninstall and remove DynamoDB Local.
remove(options)
Options for start
:
interface StartOptions {
/** Port to listen on. @default 8000 */
port: number,
/** Enable CORS support (cross-origin resource sharing) for JavaScript. You must provide a comma-separated "allow" list of specific domains. @default "*", which allows public access. */
cors: string,
/** Whether to run in memory, instead of using a database file. When you stop DynamoDB none of the data will be saved. Note that you cannot specify both dbPath and inMemory at once. @default true */
inMemory: boolean,
/** The directory where DynamoDB will write its database file. If you do not specify this option, the file will be written to the current directory. Note that you cannot specify both dbPath and inMemory at once. For the path, current working directory is <projectroot>/node_modules/aws-dynamodb-local/dynamodb. For example to create <projectroot>/node_modules/aws-dynamodb-local/dynamodb/<mypath> you should specify '<mypath>/' with a forward slash at the end. @default undefined */
dbPath: string | undefined,
/** DynamoDB will use a single database file, instead of using separate files for each credential and region. If you specify sharedDb, all DynamoDB clients will interact with the same set of tables regardless of their region and credential configuration. @default true */
sharedDb: boolean,
/** Causes DynamoDB to introduce delays for certain operations. DynamoDB can perform some tasks almost instantaneously, such as create/update/delete operations on tables and indexes; however, the actual DynamoDB service requires more time for these tasks. Setting this parameter helps DynamoDB simulate the behavior of the Amazon DynamoDB web service more closely. (Currently, this parameter introduces delays only for global secondary indexes that are in either CREATING or DELETING status.) @default true */
delayTransientStatuses: boolean,
/** Optimizes the underlying database tables before starting up DynamoDB on your computer. You must also specify -dbPath when you use this parameter. @default true */
optimizeDbBeforeStartup: boolean,
/** Prints a usage summary and options. */
help: boolean,
/** A string which sets the initial heap size e.g. '2G'. This is input to the java -Xms argument. @default undefined */
heapInitial: string | undefined,
/** A string which sets the maximum heap size e.g. '4G'. This is input to the java -Xmx argument. @default undefined */
heapMax: string | undefined,
/** Run DynamoDB inside docker container instead of as a local Java program. @default false */
docker: boolean,
/** If docker enabled, custom docker path to use. @default "docker" */
dockerPath: string,
/** If docker enabled, docker image to run. @default "amazon/dynamodb-local" */
dockerImage: string,
/** Folder where DynamoDB Local is installed to. @default ".dynamodb" */
installPath: string,
/** @deprecated Alias for installPath */
install_path: string | undefined,
}
dynamodb-localhost
This is a drop-in replacement for dynamodb-localhost
. To upgrade therefore:
dynamodb-localhost
, e.g. npm uninstall dynamodb-localhost
aws-dynamodb-local
, e.g. npm install aws-dynamodb-local
dynamodb-localhost
to aws-dynamodb-local
DynamoDB Local changes: AWS continue to make changes to DynamoDB local, including breaking changes. These changes break things in some packages, including dynamodb-localhost
.
99x have stopped maintenance: 99x used to maintain dynamodb-localhost
and serverless-dynamodb-local
. Unfortunately in recent years 99x have stopped updating these packages. They do not look likely to fix these issues soon: many issues and PRs for critical problems have been sitting around for some years now, and the libraries are effectively unusable as-is now. We tried contacting them by email about this, and asked whether they could merge the critical PRs or pass ownership to someone who would maintain the packages. We did not get a reply.
Need for stability and reliability: At Raise, we've found these packages useful for developing our open-source campaigns platform. However, these packages frequently cause us pain: having to constantly apply custom patches to them and having them break in unexpected ways. We'd like to make the packages stable and reliable for all to use, as well as support the community around these packages.
At the time of forking, we reviewed other forks available and found none of them met our criteria:
We hope to address all of these, so that people have a stable and reliable version to depend on:
dynamodb-localhost
.aws-dynamodb-local
and serverless-offline-dynamodb
. We're a charity that works in the open, with all our software projects being open-source. Our team members have experience supporting communities on several open-source projects, as well as being open-source maintainers of popular projects that accept community contributions.If you have feedback on our fork, positive or constructive, we'd love to hear it. Either open a GitHub issue or contact us using the details on our profile.
Pull requests are welcomed on GitHub! To get started:
npm install
npm run test
to run testsnpm run build
Versions follow the semantic versioning spec.
To release:
npm version <major | minor | patch>
to bump the versiongit push --follow-tags
to push with tagsaws-dynamodb-local is derived from 99x/dynamodb-localhost, which itself was derived from rynop/dynamodb-local.
FAQs
Run DynamoDB local for development and testing
The npm package aws-dynamodb-local receives a total of 10,034 weekly downloads. As such, aws-dynamodb-local popularity was classified as popular.
We found that aws-dynamodb-local demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.