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

fakecloud

v0.13.3

Published

Client SDK for fakecloud — local AWS cloud emulator

Downloads

5,838

Readme

fakecloud

TypeScript client SDK for fakecloud — a local AWS cloud emulator.

Provides typed access to the fakecloud introspection and simulation API (/_fakecloud/* endpoints), letting you inspect emulator state and trigger time-based processors in tests.

Installation

npm install fakecloud

Quick start

import { FakeCloud } from "fakecloud";

const fc = new FakeCloud("http://localhost:4566");

// Check server health
const health = await fc.health();
console.log(health.version, health.services);

// Reset all state between tests
await fc.reset();

// Inspect SES emails sent during a test
const { emails } = await fc.ses.getEmails();
console.log(`Sent ${emails.length} emails`);

// Inspect SNS messages
const { messages } = await fc.sns.getMessages();

// Inspect SQS messages across all queues
const { queues } = await fc.sqs.getMessages();

// Advance DynamoDB TTL processor
const { expiredItems } = await fc.dynamodb.tickTtl();

// Advance S3 lifecycle processor
const { expiredObjects } = await fc.s3.tickLifecycle();

API reference

FakeCloud

const fc = new FakeCloud(baseUrl?: string);

Top-level client. Defaults to http://localhost:4566.

| Method | Description | | ----------------------- | ----------------------- | | health() | Server health check | | reset() | Reset all service state | | resetService(service) | Reset a single service |

fc.lambda

| Method | Description | | ------------------------------ | ------------------------------------ | | getInvocations() | List recorded Lambda invocations | | getWarmContainers() | List warm (cached) Lambda containers | | evictContainer(functionName) | Evict a warm container |

fc.ses

| Method | Description | | ---------------------- | ----------------------------------------- | | getEmails() | List all sent emails | | simulateInbound(req) | Simulate an inbound email (receipt rules) |

fc.sns

| Method | Description | | --------------------------- | --------------------------------------- | | getMessages() | List all published messages | | getPendingConfirmations() | List subscriptions pending confirmation | | confirmSubscription(req) | Confirm a pending subscription |

fc.sqs

| Method | Description | | --------------------- | ------------------------------------- | | getMessages() | List all messages across all queues | | tickExpiration() | Tick the message expiration processor | | forceDlq(queueName) | Force all messages to the queue's DLQ |

fc.events

| Method | Description | | --------------- | -------------------------------------- | | getHistory() | Get event history and delivery records | | fireRule(req) | Fire an EventBridge rule manually |

fc.s3

| Method | Description | | -------------------- | ---------------------------- | | getNotifications() | List S3 notification events | | tickLifecycle() | Tick the lifecycle processor |

fc.dynamodb

| Method | Description | | ----------- | ---------------------- | | tickTtl() | Tick the TTL processor |

fc.secretsmanager

| Method | Description | | ---------------- | --------------------------- | | tickRotation() | Tick the rotation scheduler |

fc.cognito

| Method | Description | | -------------------------------- | ------------------------------------ | | getUserCodes(poolId, username) | Get confirmation codes for a user | | getConfirmationCodes() | List all confirmation codes | | confirmUser(req) | Confirm a user (bypass verification) | | getTokens() | List all active tokens | | expireTokens(req) | Expire tokens (optionally filtered) | | getAuthEvents() | List auth events |

fc.rds

| Method | Description | | ---------------- | ---------------------------------------- | | getInstances() | List RDS instances with runtime metadata |

fc.elasticache

| Method | Description | | ------------------------ | ----------------------------------- | | getClusters() | List ElastiCache cache clusters | | getReplicationGroups() | List ElastiCache replication groups | | getServerlessCaches() | List ElastiCache serverless caches |

fc.stepfunctions

| Method | Description | | ----------------- | ---------------------------------------- | | getExecutions() | List all state machine execution history |

fc.apigatewayv2

| Method | Description | | --------------- | ----------------------------------- | | getRequests() | List all HTTP API requests received |

fc.bedrock

| Method | Description | | ---------------------------------- | -------------------------------------------------------------------- | | getInvocations() | List recorded Bedrock runtime invocations (each has error field) | | setModelResponse(modelId, text) | Configure a single canned response for a model | | setResponseRules(modelId, rules) | Replace prompt-conditional response rules for a model | | clearResponseRules(modelId) | Clear all prompt-conditional response rules for a model | | queueFault(rule) | Queue a fault rule (e.g. ThrottlingException) for the next N calls | | getFaults() | List currently queued fault rules | | clearFaults() | Clear all queued fault rules |

Full test loop — asserting on Bedrock calls

import { FakeCloud } from "fakecloud";
import {
  BedrockRuntimeClient,
  InvokeModelCommand,
} from "@aws-sdk/client-bedrock-runtime";

const fc = new FakeCloud();
const modelId = "anthropic.claude-3-haiku-20240307-v1:0";

beforeEach(() => fc.reset());

test("classifier branches on spam vs ham", async () => {
  await fc.bedrock.setResponseRules(modelId, [
    { promptContains: "buy now", response: '{"label":"spam"}' },
    { promptContains: null, response: '{"label":"ham"}' }, // catch-all
  ]);

  await classify("hello friend"); // user code calls Bedrock
  await classify("buy now cheap pills");

  const { invocations } = await fc.bedrock.getInvocations();
  expect(invocations).toHaveLength(2);
  expect(invocations[0].output).toContain("ham");
  expect(invocations[1].output).toContain("spam");
});

test("retries on ThrottlingException", async () => {
  await fc.bedrock.queueFault({
    errorType: "ThrottlingException",
    message: "Rate exceeded",
    httpStatus: 429,
    count: 1, // only the first call faults; the retry succeeds
  });

  await classify("hello");

  const { invocations } = await fc.bedrock.getInvocations();
  expect(invocations).toHaveLength(2);
  expect(invocations[0].error).toContain("ThrottlingException");
  expect(invocations[1].error).toBeNull();
});

Error handling

All methods throw FakeCloudError on non-2xx responses:

import { FakeCloudError } from "fakecloud";

try {
  await fc.cognito.confirmUser({ userPoolId: "pool-1", username: "nobody" });
} catch (err) {
  if (err instanceof FakeCloudError) {
    console.log(err.status); // 404
    console.log(err.body); // "user not found"
  }
}