Pocket Region runs AWS services like S3, DynamoDB, and Lambda inside your Node process or a browser tab, and you call them with the ordinary AWS SDK. Your SDK calls reach the emulator as function calls, without a socket, so there's no container to start and no server to reach. Lambda handlers, Node or Python, run in child processes or Web Workers.
import { clientConfig, createRegion } from 'pocket-region/node';
import { S3Client, CreateBucketCommand, PutObjectCommand } from '@aws-sdk/client-s3';
const region = await createRegion();
const s3 = new S3Client(clientConfig(region));
await s3.send(new CreateBucketCommand({ Bucket: 'photos' }));
await s3.send(new PutObjectCommand({ Bucket: 'photos', Key: 'cat.txt', Body: 'meow' }));
await region.stop();It needs WebAssembly JSPI: Node 24.20 or later, or a browser that supports it.
The AWS APIs come from MiniStack, a Python AWS emulator that runs here under Pyodide.
In Node, a region is ready in about half a second. Resetting a region to empty takes about a millisecond for a typical test, so every test can start clean without booting a new one.
Read the docs at pocket-region.dev/docs, where you can edit and run the examples in your browser tab, or try the demo.
- Node and the browser: the same region runs in a Node process or a page, which loads the emulator from jsDelivr with no files to copy.
- Services: CloudWatch Logs, DynamoDB, EventBridge, Kinesis, KMS, S3, Secrets Manager, SNS, SQS, and SSM Parameter Store behave as they do in MiniStack, with a runnable example for each. Others, such as RDS and ECS, answer as stubs with nothing running behind them, or are untested here.
- Lambda: Node and Python functions run from a zipped deployment package, in child processes or Web Workers, with event source mappings.
- Resets and saves: empty a region between tests, or save its state to a store and boot from it later.
- Clients:
requestHandlerfor AWS SDK clients, andservefor anything that needs an endpoint. - The
awsCLI:awsClirunsawscommands and returns their output, for tests or an AWS console in your own page. - Examples in your docs: add a Run button to
code examples written for real AWS.
createRunnerruns them in the reader's tab without any Pocket Region setup in the example.
Glass Garden runs on Pocket Region. It opens on a working project, a load balancer in front of an instance group, and you can drag S3, SQS, DynamoDB, and Lambda onto the canvas and watch requests move through real code. Pocket Region started there as its AWS region and was pulled out so the same region can run in a test or any other page.