Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Latest commit

 

History

History
98 lines (63 loc) · 2.17 KB

README.md

File metadata and controls

98 lines (63 loc) · 2.17 KB

aws-dynamodb-factory-js

Validate arguments for a Javascript.

Build Status

Coverage Status

Installation

npm install --save aws-dynamodb-factory-js

Usage

Import

const DynamodbFactory = require('aws-dynamodb-factory-js')

DynamoDB

const DynamodbFactory = require('aws-dynamodb-factory-js')
let dynamo = DynamodbFactory.raw();

//return new AWS.DynamoDB({ region: 'sa-east-1' })

DynamoDB with custom options

const DynamodbFactory = require('aws-dynamodb-factory-js')
let dynamo = DynamodbFactory.raw({
    options: { ... }
});

//return new AWS.DynamoDB({ ... })

DynamoDB with local (offline)

const DynamodbFactory = require('aws-dynamodb-factory-js')

process.env.IS_OFFLINE = true;

let dynamo = DynamodbFactory.raw();

//return new AWS.DynamoDB({ region: "localhost", endpoint: "http://localhost:8000" })

let dynamoCustom = DynamodbFactory.raw({
    offlinePort: 3001
});

//return new AWS.DynamoDB({ region: "localhost", endpoint: "http://localhost:3001" })

DocumentClient

const DynamodbFactory = require('aws-dynamodb-factory-js')
let dynamo = DynamodbFactory.doc();

//return new AWS.DynamoDB.DocumentClient({ region: 'sa-east-1' })

DocumentClient with custom options

const DynamodbFactory = require('aws-dynamodb-factory-js')
let dynamo = DynamodbFactory.doc({
    options: { ... }
});

//return new AWS.DynamoDB.DocumentClient({ ... })

DocumentClient with local (offline)

const DynamodbFactory = require('aws-dynamodb-factory-js')

process.env.IS_OFFLINE = true;
let dynamo = DynamodbFactory.doc();

//return new AWS.DynamoDB.DocumentClient({ region: "localhost", endpoint: "http://localhost:8000" })

let dynamoCustom = DynamodbFactory.doc({
    offlinePort: 3001
});

//return new AWS.DynamoDB.DocumentClient({ region: "localhost", endpoint: "http://localhost:3001" })