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

dyna-moco

v0.2.1

Published

A small but useful set of helpers, making Dynamo more acute and less obtuse. (Member of the Federalies)

Downloads

4

Readme

MIT License Issues

DyanMoCo + MoCoQuery

Product Name Screen Shot

DynamoDB is great but the way you interact with it is not really great. DynaMoco is small but mighty, wrapper that is strong enough to get what you want out of DynamoDB and gentle enough to act like bowling with bumpers on.

Writeen in Typescript it should help you with auto-complete etc - if that is of interest.

The DynaMoco Problem

  1. The API of Dyanmo has a steep learning curve.
  2. Its flexibiltiy creates too much complexity to comprehend at thge outset.
  3. Dynamoco optimizes for a few use-cases that seem noramtive, making 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 Dynamo API difficult and seemingly optimzed for AWS engineers and not it's users.
  • You enjoy flexible streamlined modules.

Installation

npm install dynamoco
# or
yarn add dynamoco

Usage

There are two independent functions that work nicely together in dynamoco.

The first is the gentle wrapper - dynamoco

The second is a nice query builder - mocoquery

Each of them cover some ground on the API surface area exposed by Dyanmo.

Get Item (Full Monty)

import {Dynamo} from 'aws-sdk'
import {dynamoco} from 'dynamoco'
import {credentials} from './credentials'

;(async ()=>{
    const d = new Dyanmo({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 Query Builder

import {Dynamo} from 'aws-sdk'
import {mocoquery} from 'dynamoco'
import {credentials} from './credentials'

;(async ()=>{
    const d = new Dyanmo({credentials})
    const queryParams = mocoquery('MyTable')
                        .select('*')
                        .where(['Year','>=',2020])
                        .extract()
    // using the regular Dyanmo Client 
    const regularResults = await d.query(queryParams)
    console.log('regularResults', regularResults.Items)
    
    // using the regular Dyanmo 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). And it uses a few other packages while running tests. It is a stated goal of the project to keep the dependencies as small as reasonable. (different than as small as possible)

Dependency

Codebase

This is a Typescript codebase, and aims to be relatively up to date with the latest version. Adopting new typescript version will likely comence after some hardening period, but 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).

Contributing

Have a question? Ask it in 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

Community

See the Community Standards and Code of Conduct

Contact

Eric D Moore

Project Link: https://github.com/federalies/dynamoco

Acknowledgements & Credits

License

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