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

aws-mock-data

v1.2.3

Published

Mock data for AWS services

Downloads

8

Readme

AWS Mock Data

AWSome mock data for Node.js based AWS services

NPM Version License Release codecov

Overview

AWS Mock Data is a Node.js library that provides realistic mock data for AWS services. It’s designed to streamline the development and testing of AWS-based applications by generating valid JWT tokens, JWKs, and other mock service data.

✅ Features

  • 🔐 Generate valid Cognito JWT ID and access tokens
  • 🔑 Create JWKS (JSON Web Key Sets) for token verification
  • 📘 Written in TypeScript with full type safety
  • 🧪 Ideal for unit/integration tests and local development
  • 🚀 Zero-config setup – ready out of the box

Installation

Using npm:

npm install --save-dev aws-mock-data

Or with Yarn:

yarn add --dev aws-mock-data

Quick Start

import { awsServices, utils, types } from "aws-mock-data";

const keyPair = utils.getAsymmetricKeys();

const user: types.User = {
	emailId: "[email protected]",
	givenName: "John",
	familyName: "Doe",
	emailVerified: true
};

// Create tokens with custom configuration
const tokens = awsServices.cognito.getCognitoTokens({
	asymmetricKeys: keyPair,
	user,
	cognito: {
		groups: ["admin", "users"],
		roles: ["arn:aws:iam::123456789012:role/AdminRole"]
	},
	userPool: {
		id: "us-east-1_ABC123",
		region: "us-east-1"
	},
	jwtConfig: {
		minutesToExpiry: 60,
		authTimeInEpoch: Math.floor(Date.now() / 1000)
	}
});

API Reference

awsServices.cognito.getCognitoTokens(options)

Generates mock Cognito ID and Access tokens.

Parameters:

  • asymmetricKeys — Key pair used for signing JWTs
  • user — User information (required)
  • cognito — Optional Cognito-specific data (e.g., groups, roles)
  • userPool — Optional user pool settings
  • jwtConfig — Optional token timing configuration

Returns: CognitoTokens{ id_token, access_token }

awsServices.userPool.getUserPoolJwks(options)

Generates a JWKS (JSON Web Key Set) for token validation.

Parameters:

  • asymmetricKeys — RSA key pair for JWK generation

Returns: Single JWK object or null on failure

utils.getAsymmetricKeys(options?)

Generates an RSA key pair for signing and verification.

Options:

  • keyLength — Bit size of the key (default: 2048)

Returns: AsymmetricKeys — Key ID, PEM strings, and JWK object

Advanced Examples

Token Verification with jsonwebtoken

import jwt from "jsonwebtoken";

const keyPair = utils.getAsymmetricKeys();
const tokens = awsServices.cognito.getCognitoTokens({
	asymmetricKeys: keyPair,
	user: { emailId: "[email protected]" }
});

// Verify the token
const decoded = jwt.verify(tokens.id_token, keyPair.pem.publicKey);
console.log(decoded);

Simulated JWKS Endpoint

const keyPair = utils.getAsymmetricKeys();
const jwks = awsServices.userPool.getUserPoolJwks({
	asymmetricKeys: keyPair
});

// Mock JWKS endpoint response
const jwksResponse = {
	keys: [jwks]
};

Best Practices

🔐 Security

  • Not for production use — testing only
  • Keep private keys out of source control
  • Generate new keys per test suite when possible

⚙️ Performance

  • Reuse key pairs to speed up tests
  • Cache tokens until expiry
  • Avoid over-configuration – use sensible defaults

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Project setup
  • Running tests and linters
  • PR guidelines and code style

Changelog

See CHANGELOG.md for a detailed history of changes and releases.

License

MIT © Hanut Arora