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

Adapcon/aws-dynamodb-factory-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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" })

About

Dynamodb factory for a javascript language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published