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

art-aws

v1.29.14

Published

Streamlined APIs for AWS SDK with Promises and Art.Foundation

Downloads

134

Readme

art-aws

Streamlined APIs for AWS SDK with Promises and Art.Foundation

Currently supported:

  • DynamoDb (partial support)

Streamlined DymamoDb API

Benefits

  • all methods are wrapped in promises
  • Streamlined API
    • cleaner and dramatically reduced param size
      • reasonable defaults
      • lowerCamelCase property names for consistency with JavaScript
      • shorter property names (without sacrificing clarity)
      • method-specific params restructuring for additional clarity and reductions
    • item data read and written is always in plain JavaScript data structures (JSON-compatible data-structures)
      • currently supported: string, number, object, array
      • future: could easily add support for all DynamoDb data-types

Streamlined API Example: property names

# Streamlined API
provisioning:
  read: 1
  write: 1

# Standard API
ProvisionedThroughput:
  ReadCapacityUnits: 1
  WriteCapacityUnits: 1

Streamlined API Example: createTable

# Streamlined API:
dynamoDb.createTable
  table: "fooBarTestTable"
  key: "chatRoom/id"
  attributes:
    id:         "number"
    chatRoom:   "string"
    createdAt:  "number"

  globalIndexes:
    chatsByChatRoomCreatedAt: "chatRoom/createdAt"
.then ->
  # ...

# Standard API:
dynamoDb.createTable
  TableName: "fooBarTestTable"
  GlobalSecondaryIndexes: [
    IndexName: "chatsByChatRoomCreatedAt"
    KeySchema: [
      {AttributeName: "chatRoom", KeyType: "HASH"}
      {AttributeName: "createdAt", KeyType: "RANGE"}
    ]
    Projection: ProjectionType: "ALL"
    ProvisionedThroughput: ReadCapacityUnits: 1, WriteCapacityUnits: 1
  ]
  KeySchema: [
    {AttributeName: "chatRoom", KeyType: "HASH"}
    {AttributeName: "id", KeyType: "RANGE"}
  ]
  AttributeDefinitions: [
    {AttributeName: "id", AttributeType: "N"}
    {AttributeName: "chatRoom", AttributeType: "S"}
    {AttributeName: "createdAt", AttributeType: "N"}
  ]
  ProvisionedThroughput: ReadCapacityUnits: 1, WriteCapacityUnits: 1
.then ->
  # ...

Streamlined API Example: query

# Streamlined API
dynamoDb.query
  table: "fooBarTestTable"
  descending: true
  where:
    chatRoom: "xyz456"
    id: gt: 1
.then ({items}) ->
  # items is an array of plain javascript objects
  # Items is the standard DynamoDb-encoded Items list

# Standard API
dynamoDb.query
  TableName: "fooBarTestTable"
  ScanIndexForward: false
  KeyConditionExpression: "(#attr1 = :val1 AND #attr2 > :val2)"
  ExpressionAttributeNames:
    "#attr1": "chatRoom"
    "#attr2": "id"

  ExpressionAttributeValues:
    ":val1": S: "xyz456"
    ":val2": N: "1"
.then ({items, Items}) ->
  # items is an array of plain javascript objects
  # Items is the standard DynamoDb-encoded Items list

Usage

  • Input API
    • you can use the standard DynamoDb API params, OR
    • you can use the Streamlined API params
    • All table methods automatically detect which API you are using with this test:
      • if params.TableName
        • DynamoDb API is used
      • else
        • Streamlined API is used
        • NOTE: params.table is expected to specify the table-name
  • Output API
    • The output object contains the standard DynamoDb response
      • note: DynamoDb uses UpperCamelCase property names
    • The output object may ALSO contain streamlined-api properties
      • example: the 'items' property returned by a 'query' is a list of the result items as plain-javascript objects
      • note: the streamelined-api uses lowerCamelCase property names

Creating the Client SDK

Go here: https://sdk.amazonaws.com/builder/js/

Select:

  • dynamoDb
  • S3

Build it, copy it locally. Then update the symlink.