New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

dynamometer

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamometer

A library to easily work with DynamoDB with a single table design approach.

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
12
1100%
Maintainers
1
Weekly downloads
 
Created
Source

Dynamometer

Dynamometer logo

Dynamometer


Enforces single table design on your DynamoDB queries in an elegant way.

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

A library to easily work with DynamoDB and enforces single table design approach.

Introduction

Inspired by Firestore SDK.

Managing your data with a single design approach in DynamodDB can sometimes be difficult. Dynamometer uses so-called " Collections" and "Docs" to structure your data in an comprehensible way.

const db = Dynamometer.create({
  tableName: "dataTable"
})
Dynamometer is intended for simple, low-complexity projects and is designed to allow an architect to immediately take a
single-table approach with a DynamoDB table without having to think much about access patterns.

db.collection('USERS')
  .doc("xspvLRiJ")
  .collection("TODOS")
  .add({
    text: "Makes managing your data a breeze."
  })
# Features

Features

  • Easy to use API to query and create items in DynamoDB.
  • Data is automatically structured in single table design. `

Install

Install

npm install dynamometer
npm install dynamometer       # npm
yarn add dynamometer          # yarn
pnpm add dynamometer          # pnpm

Usage

Basic usage

Create a instance of the dynamometer client.

import { Dynamometer } from 'dynamometer';

const db = Dynamometer.create({
  tableName: "dataTable"
})

Collection

A collection holds a number of items.

Creating a collection

const collection = db.collection("USERS")

With a collection, items can be added to it or all can be queried.

Adding an item


collection.add({
  name: "John Doe"
})

Query all Items


const reponse = await collection.get()

Doc

If you know the ID of an item in the collection or you want to give it your own ID you can use the doc methode.

// get the doc
collection.doc("123").get()

// add the doc with the id 123
collection.doc("123").add({
  name: "John Doe"
})

Document

A document is an item of a collection. It offers CRUD methodes.

Doc

If you know the ID of an item in the collection or you want to give it your own ID you can use the doc methode.

Creating a document

const doc = db.collection("USERS").doc("123")

Set doc data

 const repsonse = await doc.set({
  name: "John Doe"
})

Get doc data

const data = await doc.get()

Update doc

const response = await doc.update({
  name: "John Doester"
})

Delete doc

const response = await doc.delete()

Keywords

dynamodb

FAQs

Package last updated on 03 Oct 2023

Did you know?

Socket

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.

Install

Related posts