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

@renatorodrigues/cacheiro-store-s3

v1.0.2

Published

S3 store implementation for @renatorodrigues/cacheiro

Downloads

5,279

Readme

@renatorodrigues/cacheiro-store-s3

S3 store for @renatorodrigues/cacheiro. Stores Nx cache artifacts in an AWS S3 bucket (or any S3-compatible storage: MinIO, LocalStack, DigitalOcean Spaces, Cloudflare R2).

Usage

import { S3Store } from '@renatorodrigues/cacheiro-store-s3';

const store = new S3Store({
  bucket: 'my-nx-cache',
  region: 'us-east-1',
});

await store.mount();

Config validation

This package exports a JSON Schema (draft-07) and a TypeScript type for the config shape. Use them to validate and cast a raw config object before constructing the store — the example below uses AJV, but any JSON Schema validator works:

import { configSchema, type S3StoreConfig } from '@renatorodrigues/cacheiro-store-s3';
import { Ajv } from 'ajv';

const validate = new Ajv({ allErrors: true }).compile(configSchema);

// example — error handling is up to your runner
if (!validate(raw)) throw new Error('invalid store config');
const store = new S3Store(raw as unknown as S3StoreConfig);

Development

npm run watch        # tsc --watch (hot rebuild)
npm run build        # compile TypeScript
npm test             # vitest run
npm run test:watch
npm run lint
npm run fmt

Config

| Field | Type | Required | Description | | ---------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ | | bucket | string | Yes | S3 bucket name. | | region | string | Yes | AWS region (e.g. us-east-1). | | endpoint | string | No | Custom S3-compatible endpoint URL (MinIO, LocalStack, etc.). | | accessKeyId | string | No | AWS access key ID. Falls back to the AWS credential chain (AWS_ACCESS_KEY_ID env var, AWS_PROFILE, IAM role, etc.) when omitted. | | secretAccessKey | string | No | AWS secret access key. Falls back to the AWS credential chain (AWS_SECRET_ACCESS_KEY env var, IAM role, etc.) when omitted. | | forcePathStyle | boolean | No | Use path-style URLs instead of virtual-hosted. Required for most S3-compatible storage. Default: false. | | prefix | string | No | Key prefix for all cache entries. Useful when sharing a bucket across projects. | | encryptionKey | string | No | Client-side AES-256-CBC encryption key. When set, artifacts are encrypted before upload. | | ssoProfile | string | No | AWS SSO profile name. Falls back to the AWS_PROFILE env var when omitted. | | disableChecksum | boolean | No | Disable AWS response checksum validation. Default: false. | | serverSideEncryption | boolean | No | Enable S3 SSE-S3 (AES256) server-side encryption. Ignored when encryptionKey is set. Default: false. |

See Environment variables reference for conventional env var names.

Encryption

Two mutually exclusive modes are supported:

| encryptionKey | serverSideEncryption | Behavior | | --------------- | ---------------------- | --------------------------------------------------------------- | | set | false | Client-side AES-256-CBC. Bytes encrypted locally before upload. | | unset | true | S3 SSE-S3. AWS encrypts at rest with managed keys. | | set | true | Warns and uses client-side only. | | unset | false | No encryption (relies on bucket policies and TLS in transit). |

Client-side keys are stretched with scrypt (fixed salt, default cost) to a 32-byte AES key. The IV is randomly generated per write and prepended to the ciphertext: [16-byte IV][ciphertext]. This KDF differs from the deprecated official Nx S3 plugin (which truncated/repeated the key), so buckets encrypted with the upstream plugin are not interoperable.

Environment variables reference

| Variable | Config field | | --------------------------- | ---------------------- | | S3_BUCKET | bucket | | S3_REGION | region | | S3_ENDPOINT | endpoint | | AWS_ACCESS_KEY_ID | accessKeyId | | AWS_SECRET_ACCESS_KEY | secretAccessKey | | AWS_PROFILE | ssoProfile | | S3_FORCE_PATH_STYLE | forcePathStyle | | S3_PREFIX | prefix | | S3_ENCRYPTION_KEY | encryptionKey | | S3_DISABLE_CHECKSUM | disableChecksum | | S3_SERVER_SIDE_ENCRYPTION | serverSideEncryption |