AWS services like S3, DynamoDB, and Lambda inside Node or a browser tab, reached with the ordinary AWS SDK
See the codePocket 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 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.
requestHandler for AWS SDK clients,
and serve for anything that needs an endpoint.aws CLI: awsCli runs aws commands and
returns their output, for tests or an AWS console in your own page.createRunner runs 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.
140 commits
TypeScript
73.8%
MDX
10.2%
Astro
5.6%
JavaScript
5.1%
Python
3.7%
CSS
1.6%
AWS services like S3, DynamoDB, and Lambda inside Node or a browser tab, reached with the ordinary AWS SDK
See the codePocket 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 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.
requestHandler for AWS SDK clients,
and serve for anything that needs an endpoint.aws CLI: awsCli runs aws commands and
returns their output, for tests or an AWS console in your own page.createRunner runs 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.
140 commits
TypeScript
73.8%
MDX
10.2%
Astro
5.6%
JavaScript
5.1%
Python
3.7%
CSS
1.6%