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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chainsaws/aws-core

v0.1.2

Published

Shared AWS client helpers for Chainsaws Node packages.

Readme

@chainsaws/aws-core

Shared AWS client helpers for Chainsaws Node packages.

This package is intentionally small. It exists to keep the common transport-facing contract aligned across service packages without introducing a heavy Session or base-client abstraction.

Installation

npm install @chainsaws/aws-core
yarn add @chainsaws/aws-core
pnpm add @chainsaws/aws-core

This package is ESM-only.

Package Surface

@chainsaws/aws-core exports four things:

  • AWSCredentialsInput
  • AWSClientConfig
  • create_aws_client_config(...)
  • create_aws_request_handler(...)
  • extract_aws_service_error(...)

These are the shared pieces used by @chainsaws/s3, @chainsaws/sqs, @chainsaws/sns, @chainsaws/ssm, @chainsaws/dynamodb, and @chainsaws/lambda.

Shared Config

import { create_aws_client_config } from "@chainsaws/aws-core";

const config = create_aws_client_config({
  region: "ap-northeast-2",
  endpoint: "http://localhost:4566",
  max_pool_connections: 100,
  credentials: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    sessionToken: process.env.AWS_SESSION_TOKEN,
  },
});

Shared keys:

  • region
  • endpoint
  • credentials
  • max_pool_connections

create_aws_client_config(...) only keeps these common keys. That lets a service package merge shared AWS config with its own options without creating a cross-service base class.

Shared Transport Helper

import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { create_aws_request_handler } from "@chainsaws/aws-core";

const client = new DynamoDBClient({
  region: "ap-northeast-2",
  requestHandler: create_aws_request_handler(100),
});

Use this when constructing AWS SDK v3 clients that should share the same HTTP connection-pool behavior. When max_pool_connections is missing or <= 0, the helper returns undefined so the SDK falls back to its default transport.

Shared Error Extraction

import { extract_aws_service_error } from "@chainsaws/aws-core";

try {
  // AWS SDK call
} catch (error) {
  const serviceError = extract_aws_service_error(error);
  console.error(
    serviceError?.code,
    serviceError?.message,
    serviceError?.request_id,
  );
}

This reads the common Smithy-style error payload:

  • error.response.Error.Code
  • error.response.Error.Message
  • error.response.ResponseMetadata.RequestId
  • error.response.ResponseMetadata.HTTPStatusCode

It is deliberately conservative. If the error does not match that shape, the helper returns undefined.

Typical Usage in a Service Package

import { SQSClient } from "@aws-sdk/client-sqs";
import {
  create_aws_client_config,
  create_aws_request_handler,
} from "@chainsaws/aws-core";

const config = create_aws_client_config({
  region: "ap-northeast-2",
  endpoint: process.env.SQS_ENDPOINT,
  max_pool_connections: 50,
});

const client = new SQSClient({
  region: config.region,
  endpoint: config.endpoint,
  credentials: config.credentials,
  requestHandler: create_aws_request_handler(config.max_pool_connections),
});

What This Package Does Not Do

It intentionally does not provide:

  • a boto-style Session
  • a generic AWS service base class
  • global retry or backoff policy orchestration
  • shared request serialization across unrelated AWS services

Those abstractions are broader than the current common surface and would add more ceremony than value.