Registry / aws / aws-client

aws-client

JSON →
library0.11jsnpmunverified

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.

npm install aws-client
INSTALL
IMPORT
SIG · AWS-CLIENT
A
aws-client
awsjavascriptv0.11
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DynamoClient
import { DynamoClient } from 'aws-client'
const DynamoClient = require('aws-client').DynamoClient
ES6 named import. For CommonJS, use destructuring `const { DynamoClient } = require('aws-client')`.
SNSClient
import { SNSClient } from 'aws-client'
const SNSClient = require('aws-client').SNSClient
ES6 named import. For CommonJS, use destructuring `const { SNSClient } = require('aws-client')`.
{ DynamoClient, SNSClient }
import { DynamoClient, SNSClient } from 'aws-client'
import awsClient from 'aws-client'; const dynamo = new awsClient.DynamoClient(...)
The library exports named clients, not a default export or a single object containing all clients. Always use named imports or destructuring require.

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();
Debug
Known issues
gotchaPrior to version 2, `aws-client` functions required the full `aws-sdk` package. With the introduction of 'v2 functions' in version 2, the library began using modular AWS SDK v3 packages internally. However, if you are still using 'v1 functions', you *must* explicitly install `aws-sdk` as a separate dependency.
fix
If using `v1` functions, run `npm install aws-sdk`. It is recommended to migrate to the `v2` functions as `v1` functions will eventually be deprecated and removed.
affects: >=2.0.0
gotcha`aws-client` is intentionally minimalist and only supports a limited set of operations for DynamoDB and SNS. It does not provide full coverage of all AWS services or all operations within supported services. Attempting to use an unsupported service or operation will result in runtime errors.
fix
Consult the package documentation for the list of supported services and operations. For broader AWS service coverage or unsupported operations, consider using the official AWS SDK directly.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'aws-sdk'
Legacy 'v1' functions were used without installing the `aws-sdk` package, which became an optional peer dependency for those functions starting in v2.
fix
Run `npm install aws-sdk` if you intend to use 'v1' functions. Otherwise, refactor your code to use 'v2' functions which do not have this dependency.
TypeError: client.unsupportedMethod is not a function
Attempting to call an AWS service method that `aws-client` does not explicitly wrap or support. The library provides a minimalist API.
fix
Verify that the desired operation is listed in the `aws-client` documentation for the specific client (e.g., `DynamoClient`, `SNSClient`). If not supported, use the official AWS SDK directly for that operation.
Upgrade
Version history
0.11latest on npm
Audit
Dependencies
aws-sdkoptionalRequired for 'v1 functions'. 'v2 functions' use modular AWS SDK v3 packages internally and do not require this explicit dependency.
Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources
aws-client — npm install aws-client · libregistry