How to use amplify-dynamodb-simulator - 4 common examples

To help you get started, we’ve selected a few amplify-dynamodb-simulator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-cli / packages / amplify-util-mock / src / api / api.ts View on Github external
private async startDynamoDBLocalServer(context) {
    const { projectPath } = context.amplify.getEnvInfo();
    const dbPath = path.join(await getMockDataDirectory(context), 'dynamodb');
    fs.ensureDirSync(dbPath);
    this.ddbEmulator = await dynamoEmulator.launch({
      dbPath,
      port: null,
    });
    return dynamoEmulator.getClient(this.ddbEmulator);
  }
github aws-amplify / amplify-cli / packages / amplify-util-mock / src / __e2e__ / utils / index.ts View on Github external
export async function launchDDBLocal() {
  let dbPath;
  while (true) {
    dbPath = path.join('/tmp', `amplify-cli-emulator-dynamodb-${v4()}`);
    if (!fs.existsSync(dbPath)) break;
  }

  fs.ensureDirSync(dbPath);
  const emulator = await dynamoEmulator.launch({
    dbPath,
    port: null,
  });
  const client = await dynamoEmulator.getClient(emulator);
  logDebug(dbPath);
  return { emulator, dbPath, client };
}
github aws-amplify / amplify-cli / packages / amplify-util-mock / src / api / api.ts View on Github external
private async startDynamoDBLocalServer(context) {
    const { projectPath } = context.amplify.getEnvInfo();
    const dbPath = path.join(await getMockDataDirectory(context), 'dynamodb');
    fs.ensureDirSync(dbPath);
    this.ddbEmulator = await dynamoEmulator.launch({
      dbPath,
      port: null,
    });
    return dynamoEmulator.getClient(this.ddbEmulator);
  }
github aws-amplify / amplify-cli / packages / amplify-util-mock / src / __e2e__ / utils / index.ts View on Github external
export async function launchDDBLocal() {
  let dbPath;
  while (true) {
    dbPath = path.join('/tmp', `amplify-cli-emulator-dynamodb-${v4()}`);
    if (!fs.existsSync(dbPath)) break;
  }

  fs.ensureDirSync(dbPath);
  const emulator = await dynamoEmulator.launch({
    dbPath,
    port: null,
  });
  const client = await dynamoEmulator.getClient(emulator);
  logDebug(dbPath);
  return { emulator, dbPath, client };
}

amplify-dynamodb-simulator

DynamoDB emulator nodejs wrapper

Apache-2.0
Latest version published 4 months ago

Package Health Score

86 / 100
Full package analysis