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

@karmaniverous/aws-s3-tools

v0.1.1

Published

X-Ray-enabled AWS S3 client wrapper and get-dotenv CLI plugin.

Readme

AWS S3 Tools

X-Ray-enabled AWS S3 client wrapper and get-dotenv CLI plugin for listing objects, generating pre-signed URLs, and batch deleting under a prefix — with an escape hatch to the fully configured SDK client for any other S3 operation.

Documentation

Install

npm i @karmaniverous/aws-s3-tools

This package is ESM-only (Node >= 22).

Quick start (programmatic)

import { AwsS3Tools } from '@karmaniverous/aws-s3-tools';

const tools = new AwsS3Tools({
  clientConfig: { region: 'us-east-1', logger: console },
  xray: 'auto',
});

// List all objects under a prefix
const objects = await tools.listAllObjects({
  bucket: 'my-bucket',
  prefix: 'uploads/',
  maxKeys: 1000,
});

// Generate a pre-signed download URL
const url = await tools.getPresignedGetUrl({
  bucket: 'my-bucket',
  key: 'uploads/file.txt',
  expiresIn: 3600,
});

// Generate a pre-signed upload URL
const putUrl = await tools.getPresignedPutUrl({
  bucket: 'my-bucket',
  key: 'uploads/new-file.txt',
  contentType: 'text/plain',
});

// Escape hatch: use the fully configured SDK client directly
import { PutObjectCommand } from '@aws-sdk/client-s3';
await tools.client.send(
  new PutObjectCommand({
    Bucket: 'my-bucket',
    Key: 'hello.txt',
    Body: 'Hello, world!',
    ContentType: 'text/plain',
  }),
);

Quick start (plugin)

Mount in your get-dotenv CLI:

import { createCli } from '@karmaniverous/get-dotenv/cli';
import { awsPlugin } from '@karmaniverous/get-dotenv/plugins';
import { s3Plugin } from '@karmaniverous/aws-s3-tools';

await createCli({
  alias: 'smoz',
  compose: (program) =>
    program.use(awsPlugin().use(s3Plugin())),
})();

Then use the CLI:

# List objects in a bucket
smoz --env dev aws s3 list --bucket my-bucket --prefix uploads/

# Generate a pre-signed download URL
smoz --env dev aws s3 presign --bucket my-bucket --key path/to/file.txt

Quick start (standalone CLI)

# List objects
aws-s3-tools --env dev aws s3 list --bucket my-bucket

# Pre-signed GET URL (download)
aws-s3-tools --env dev aws s3 presign --bucket my-bucket --key path/to/file.txt

# Pre-signed PUT URL (upload)
aws-s3-tools --env dev aws s3 presign \
  --bucket my-bucket \
  --key uploads/new-file.txt \
  --method put \
  --content-type text/plain \
  --expires-in 3600

Notes:

  • --env is a root-level (get-dotenv) option and must appear before the command path.
  • --bucket supports $VAR expansion evaluated at action time against { ...process.env, ...ctx.dotenv }.

AWS X-Ray capture (optional)

X-Ray support is guarded:

  • Default behavior is xray: 'auto': capture is enabled only when AWS_XRAY_DAEMON_ADDRESS is set.
  • To enable capture, install the optional peer dependency: aws-xray-sdk
  • In auto mode, if AWS_XRAY_DAEMON_ADDRESS is set but aws-xray-sdk is not installed, construction throws.

See @karmaniverous/aws-xray-tools for details.


See CHANGELOG for release history.