npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@federalies/dynamoco

v0.7.0

Published

A small but mighty wrapper for AWS.DynamoDB that make it actually fun to use. (Maintained by The Federalies)

Downloads

8

Readme

NPM Version Pkg Size Code Coverage MIT License

Github Activity Issues Closed Issues

Dynamoco + Mocoquery

Github Action - Node Integration Build/Test

Overview

DynamoDB is a datastore that allows you to not manage as many details as a regular database. You just give it data; it faithfully holds it, and pretty quickly gives it back to you when you ask for it. Sound geat, right?!?! It's almost great. DynamoDB is a solid product from AWS, but the way you interact with it feels like shoving your finger in your eye.

Enter: Dynamoco!

A small but mighty, wrapper that is strong enough to get what you want out of DynamoDB, and it's gentle enough to help you feel like you are bowling with bumpers up. #NoGutters

Writeen in Typescript, it helps you auto-complete your way to valid queries, and other ways to pull your data out. It also helps you with type-check compiling and all that jazz if you are into that. If not its super easy to add it as regular ol' javascript yall.

The Dynamoco Problem

  1. The API of DynamoDB has a steep learning curve.
  2. The flexibiltiy in the DynamoDB Client creates too much complexity to comprehend when you are just getting started.
  3. Dynamoco optimizes for a few normative use-cases, and it makes those very easy.
  4. If you need to do the more complicated parts, it attempts to move out of the way.

The Dynamoco Solution

Use this package if:

  • You need to just get going with DynamoDB

  • You find the DynamoDB API difficult or at least optimzed for AWS engineers and not you.

  • Streamlined and flexible modules are your kind of your thing.

  • its like getting dynamo-converter, and dynamo-client and dynamo-plus all for the price of one.

Installation

npm install @federalies/dynamoco
# or
yarn add @federalies/dynamoco

Usage

First, know that this package is the ultimate BOGO or Two-For-One. Yes friends,there are in fact two, count them, two independent functions that work nicely together in the dynamoco module. Both come tested and documented free to you. What a time to be alive!

The first function is the gentle wrapper and the module namesake. (dynamoco)

But wait there's more, for free, you get a second and not to be overlooked, incredibly pleasant query builder - mocoquery

Together this dynamic duo cover ground on the API exposed by DynamoDB.

Using Get Item

import {DynamoDB} from 'aws-sdk'
import {dynamoco} from '@federalies/dynamoco'  // yay for tree-shaking
import {credentials} from './credentials'

;(async ()=>{
    const d = new DynamoDB({credentials})
    const moco = dynamoco(d)
    // using a table that is already available
    const resutls = await moco.getItem('MyTable', {MyKey: 'SomeValue'})
    console.log(results._Item) 
        /* {    
                MyKey: 'SomeValue', 
                numberValues: 1,
                stringValues: 'strings are strings'
            } 
        */
})()

Using The MocoQuery Builder

import {DynamoDB} from 'aws-sdk'
import {mocoquery, dynamoco} from '@federalies/dynamoco'
import {credentials} from './credentials'

;(async ()=>{
    const d = new DynamoDB({credentials})
    const queryParams = mocoquery('MyTable')
                        .select('*')
                        .where(['Year','<=',2020])
                        .extract()

    // using the regular DynamoDB Client 
    const regularResults = await d.query(queryParams)
    console.log('regularResults', regularResults.Items)
    
    // using the regular DynamoDB Client 
    const ezResults = await dynamoco(d).query(queryParams)
    console.log('ezResults', ezResults._Items)
})()

For more examples, please refer to the Documentation

Technical

Single dependency

By design, this module has a single, external, run-time dependency (aws-sdk). It uses a few other packages with tests, and some built-in modules to node. It is a stated goal of the project to keep the dependencies as small as reasonable. (NOTE: that is not equivalent to "as small as possible")

Dependencies

Codebase

This is a Typescript codebase, and aims to be relatively up to date with the latest version. Adopting typescript versions updates will likely comence after a version hardening period in the wild, but might be hastened if a new language feature has been added that substantially supports this project.

Roadmap

See the open issues for a list of proposed features (and known issues).

Wait, But WHY?

But hey Eric, didn't you see any of :

Quite simply... Nope. Nope. Nope.

I did not. This project was made in anger after dealing with the regular documentation for Dynamo that NEVER even mentions there is an easier way. Not once... Not until had dug to the bottom of thier docs, did I discover that the Document API and higher level API exist.

Lesson(s) Learned:

  • Importance of Reading The Docs
  • How to Publish an NPM module :P ( thanks np )
  • Github Pages
  • Github Actions
  • lots more

Would I recommend anyone use this module - I tihnk so :shrug:

Community

Coming soon:

  • Community Chat
  • Stack Overflow hashtags
  • And Other Supporting Documentation

See the Community Standards and Code of Conduct

Contact

Eric D Moore

Contributing

Have a question? Ask your question inside an issue! We'd love to hear from you.

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contributors

Made with :heart: by @ericdmoore and maybe you?

use the emoji legend

This project follows the all-contributors specification. Contributions of any kind welcome!

Acknowledgements & Credits

License

Distributed under the MIT License. See LICENSE for more information.