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

@rank-lang/plugin-aws

v0.3.1

Published

AWS provider workspace package

Readme

@rank-lang/plugin-aws

First-party AWS provider package for Rank.

Full documentation →

Install

Reference the provider from your Rank manifest:

manifestVersion = 1

[package]
name = "aws-example"
version = "0.1.0"
source = "src"

[providers]
aws = { registry = "npm", package = "@rank-lang/plugin-aws", version = "0.1.0" }

The package exports three modules under the aws namespace:

use aws::{ DynamoDB, S3, SecretsManager }

Current scope

  • AWS SDK v3-backed getter implementations for DynamoDB::Item, DynamoDB::Query, S3::Object, and SecretsManager::Secret
  • AWS SDK v3-backed DynamoDB::Put mutation receipts with optional condition support
  • AWS SDK v3-backed DynamoDB::Update mutation receipts with shallow SET updates and optional condition support
  • AWS SDK v3-backed S3::Put mutation receipts with JSON serialization and optional eTag / versionId
  • provider-owned Rank source modules for aws::DynamoDB, aws::S3, and aws::SecretsManager
  • plain module createClient helpers and typed schema aliases
  • focused mocked Vitest coverage for the fast inner loop
  • LocalStack-backed integration coverage for real DynamoDB, S3, and Secrets Manager requests

The v1 getter and mutator surface is implemented. Remaining work is phase-4 hardening around packaged-provider smoke coverage and broader host-flow validation.

Quick start

Create serializable client configs with the provider-owned helpers:

use aws::{ DynamoDB, S3, SecretsManager }

dynamoClient: aws::DynamoDB::ClientConfig = DynamoDB::createClient({
  region: `us-east-1`,
})

s3Client: aws::S3::ClientConfig = S3::createClient({
  region: `us-east-1`,
})

secretsClient: aws::SecretsManager::ClientConfig = SecretsManager::createClient({
  region: `us-east-1`,
})

These values are plain serializable configs. The provider runtime memoizes the real AWS SDK clients per live provider session.

Getter example

use aws::{ DynamoDB, S3, SecretsManager }

User = Object {
	userId: string,
	email: string,
	status: `active` | `inactive`,
}

UsersTable = DynamoDB::Table<User, `userId`>

dynamoClient: aws::DynamoDB::ClientConfig = DynamoDB::createClient({
	region: `us-east-1`,
})

{ item, metadata } = DynamoDB::Item<UsersTable> {
	client: dynamoClient,
	tableName: `Users`,
	key: {
		userId: `123`,
	},
}

DynamoDB::Query<Resource> uses explicit runtime target metadata and, for index queries, a resource-constrained indexName field. S3::Object<T> reads UTF-8 JSON objects, and SecretsManager::Secret<T> requires format: string or format: json.

Mutation example

use aws::DynamoDB::{ Table, UpdatePatch }
use std::Mutation

User = Object {
	userId: string,
	email: string,
	status: `active` | `inactive`,
}

UsersTable = Table<User, `userId`>
UserPatch = UpdatePatch<UsersTable>

dynamoClient: aws::DynamoDB::ClientConfig = aws::DynamoDB::createClient({
	region: `us-east-1`,
})

s3Client: aws::S3::ClientConfig = aws::S3::createClient({
	region: `us-east-1`,
})

putUser: Mutation::Effect<User> = aws::DynamoDB::Put<UsersTable> {
	client: dynamoClient,
	tableName: `Users`,
}

activateUser: Mutation::Effect<UserPatch> = aws::DynamoDB::Update<UsersTable, UserPatch> {
	client: dynamoClient,
	tableName: `Users`,
	key: {
		userId: `123`,
	},
}

uploadUser: Mutation::Effect<User> = aws::S3::Put<User> {
	client: s3Client,
	bucket: `profiles`,
	key: `users/123.json`,
}

created = putUser({
	userId: `123`,
	email: `[email protected]`,
	status: `inactive`,
})

activated = activateUser({
	status: `active`,
})

uploaded = uploadUser({
	userId: created.userId,
	email: created.email,
	status: created.status,
})

Fulfillment returns the declared payload value, which stays commit-local and can feed later mutation inputs. Receipt metadata is retained for commit summaries and Mutation::commit(...) projection.

Serve-time JSON and YAML responses may also realize a top-level Mutation::commit(...) body, so AWS receipt metadata can flow directly into HTTP::Response output when needed.

API notes

DynamoDB

  • Table<T, PK, SK?> declares the base table schema.
  • GSI<BaseTable, Name, IndexTable> and LSI<BaseTable, Name, IndexTable> declare query-only secondary-index schemas.
  • KeyInput<Table> derives the exact key object from the declared table schema.
  • UpdatePatch<Table> is shallow and excludes the declared key fields.
  • QueryInput<Resource> specializes table, GSI, and LSI query inputs from the selected resource kind.

Receipts and metadata

  • getter results return metadata: RequestMetadata or PageMetadata
  • DynamoDB::PutReceipt and DynamoDB::UpdateReceipt include requestId plus optional consumed-capacity summaries
  • S3::PutReceipt includes requestId plus optional eTag and versionId

Operator notes

IAM and credentials

  • this provider assumes the admitted AWS principal is already least-privilege for the tables, buckets, and secrets you intend the program to access
  • use service-specific IAM policies to scope real permissions; the Rank host does not yet add AWS-specific table or bucket allowlists on top of IAM
  • when credentials come from Env, source them through @sensitive destructuring so they stay redacted in diagnostics

Example:

use std::Env

SysEnvironment = Object {
	AWS_ACCESS_KEY_ID: string,
	AWS_SECRET_ACCESS_KEY: string,
	...: string,
}

@sensitive
{ AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY } = Env<SysEnvironment> {}

Mutation admission

Mutation exports are separately default-denied. In addition to admitting provider capabilities such as network, your host config must explicitly allow the reachable mutation export names.

[security]
allow-provider-capabilities = ["network"]
allow-provider-mutation-exports = [
	"aws::DynamoDB::Put",
	"aws::DynamoDB::Update",
	"aws::S3::Put",
]

LocalStack

The package keeps a pinned LocalStack harness in test/localstack/docker-compose.yml covering DynamoDB, S3, and Secrets Manager.

Typical workflow:

npm run localstack:up -w @rank-lang/plugin-aws
npm run test:localstack -w @rank-lang/plugin-aws
npm run localstack:down -w @rank-lang/plugin-aws

Known v1 limitations

  • S3::Object<T> and S3::Put<T> are JSON-only in v1
  • SecretsManager::Secret<T> supports SecretString only; SecretBinary is rejected
  • DynamoDB::Update<Table, Patch> lowers only shallow SET updates; removal helpers and deeper path operations are deferred
  • DynamoDB::Query<Resource> uses native DynamoDB expression strings rather than a typed expression DSL
  • resource-scoped host allowlists for AWS tables, buckets, and secrets are deferred; rely on IAM plus the generic mutation-export allowlist

Development

npm run build -w @rank-lang/plugin-aws
npm run typecheck -w @rank-lang/plugin-aws
npm run test -w @rank-lang/plugin-aws
npm run test:localstack -w @rank-lang/plugin-aws

npm run test:localstack -w @rank-lang/plugin-aws requires docker compose and starts a pinned LocalStack container defined in test/localstack/docker-compose.yml.

Publishing

Build the package first, then publish from the workspace root:

npm run build -w @rank-lang/plugin-aws
npm publish -w @rank-lang/plugin-aws

Like the Faker plugin, this package currently relies on normal npm runtime dependencies rather than a fully bundled standalone provider artifact. In particular, it expects @aws-sdk/*, @aws-sdk/lib-dynamodb, and @rank-lang/provider-runtime to materialize as runtime npm dependencies when the package is installed from a registry.