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

local-web-services-javascript-sdk

v0.2.0

Published

JavaScript testing SDK for local-web-services — subprocess-based AWS service fixtures for testing

Readme

local-web-services-javascript-sdk

JavaScript testing SDK for local-web-services — spawns ldk dev in a subprocess and provides pre-configured AWS SDK v3 clients for testing.

Prerequisites

Install local-web-services:

pip install local-web-services

Installation

npm install local-web-services-javascript-sdk
# or
pnpm add local-web-services-javascript-sdk

Quick start

const { LwsSession } = require('local-web-services-javascript-sdk');

// Auto-discover from a CDK project (runs ldk dev against cdk.out/)
const session = await LwsSession.fromCdk('../my-cdk-project');

// Auto-discover from a Terraform project
const session = await LwsSession.fromHcl('../my-terraform-project');

// Explicit resource declaration
const session = await LwsSession.create({
  tables: [{ name: 'Orders', partitionKey: 'id' }],
  queues: ['OrderQueue'],
  buckets: ['ReceiptsBucket'],
});

// Get a fully-configured AWS SDK v3 client
const dynamodb = session.client('dynamodb');

// Use the helper API
const table = session.dynamodb('Orders');
await table.put({ id: { S: '1' }, status: { S: 'pending' } });
const items = await table.scan();
console.log(items.length); // 1

// Always close the session when done
await session.close();

Jest example

// jest.config.js
module.exports = {
  testEnvironment: 'node',
  testTimeout: 60000,   // ldk dev needs time to start
};

// orders.test.js
const { LwsSession } = require('local-web-services-javascript-sdk');

let session;

beforeAll(async () => {
  session = await LwsSession.create({
    tables: [{ name: 'Orders', partitionKey: 'id' }],
  });
});

afterAll(async () => {
  await session.close();
});

beforeEach(async () => {
  await session.reset();
});

test('creates an order', async () => {
  const table = session.dynamodb('Orders');
  await table.put({ id: { S: '42' }, status: { S: 'pending' } });

  const item = await table.assertItemExists({ id: { S: '42' } });
  expect(item.status.S).toBe('pending');
});

Drop-in AWS endpoint redirection

When a session starts, AWS_ENDPOINT_URL_* environment variables are automatically set for all supported services. Any AWS SDK v3 client created after the session starts — including clients in your production code — will hit the local LWS services without any code changes:

// production code
const { DynamoDBClient } = require('@aws-sdk/client-dynamodb');
const client = new DynamoDBClient({}); // picks up AWS_ENDPOINT_URL_DYNAMODB automatically

// test code — no endpoint configuration needed
const session = await LwsSession.create({ tables: [{ name: 'Orders', partitionKey: 'id' }] });
// production client now talks to LWS

Env vars are restored when session.close() is called.

API

LwsSession

| Method | Description | |--------|-------------| | LwsSession.create(spec) | Start with explicit resource spec | | LwsSession.fromCdk(projectDir) | Auto-discover from CDK cloud assembly | | LwsSession.fromHcl(projectDir) | Auto-discover from Terraform .tf files | | session.client(service) | Get AWS SDK v3 client | | session.dynamodb(tableName) | Get DynamoDBHelper | | session.sqs(queueName) | Get SQSHelper | | session.s3(bucketName) | Get S3Helper | | session.reset() | Clear all state (use in beforeEach) | | session.close() | Stop ldk dev process | | session.queueUrl(queueName) | Get local SQS queue URL | | session.portFor(service) | Get port number for a service | | session.fake(service) | Get FakeBuilder for service | | session.chaos(service) | Get ChaosBuilder for service | | session.iam | Get IamBuilder |

Supported services

dynamodb, s3, sqs, sns, ssm, secretsmanager, stepfunctions

License

MIT