Minimalist AWS Client for Node.js

3.0.6 · active · verified Tue Apr 21

aws-client is a minimalist Node.js client library providing simplified access to a subset of AWS services. Currently, it supports core operations for DynamoDB (get, batchGet, put, batchPut, query) via `DynamoClient` and SNS (publish) via `SNSClient`. The package is at version 3.0.6 and appears to be actively maintained, with an ongoing migration of "v1 functions" to "v2 functions." A key differentiator is its focus on minimalism and efficiency: v2 functions leverage the modular packages of the AWS SDK v3 internally, reducing the overall dependency footprint compared to requiring the full `aws-sdk` package. However, users employing older "v1 functions" must still explicitly install `aws-sdk` as a peer dependency, a requirement that will be phased out as the migration completes.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates initializing a DynamoClient and fetching an item by ID. Includes error handling and shows the minimalist API for a common DynamoDB operation.

import { DynamoClient } from 'aws-client';

const client = new DynamoClient({
  region: 'eu-west-1',
  tableName: 'users-prod'
});

const getUser = async (id) => {
  try {
    const data = await client.get({ id });
    console.log('User data:', data);
  } catch (error) {
    console.error('Error fetching user:', error.message);
  }
};

getUser('fred');
// Example: batch operations (if 'users-prod' has items with ids 'fred' and 'jane')
// const getMultipleUsers = async () => {
//   const data = await client.batchGet(['fred', 'jane']);
//   console.log('Batch user data:', data);
// };
// getMultipleUsers();

view raw JSON →