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

aimock

v0.2.9

Published

An OpenAI api simulator for developing and testing

Readme

aimock

AIMock is a service built on Node.js and Express.js designed to emulate the behavior of OpenAI's APIs. It can receive API requests and return mock responses for chat completions, text generation, and image generation. This service is perfect for development and testing when actual AI-generated results are not required.

Installation

Run with npx:

npx aimock

Install in your project:

npm install aimock
# or
yarn add aimock

Install globally:

npm install -g aimock

Getting Started

You can set environment variables in a .env file to specify configurations for the service. The following environment variables are available:

  • MOCK_PORT: The port for the service, default is 5001
  • MOCK_TYPE: The type of mock responses, options are "random", "echo", or "fixed", default is "random"
  • MOCK_FILE: The path to a text file for randomly generating response content, default is "data/contents.txt"
  • MOCK_FILE_SEPARATOR: The separator for different response contents in the text file, default is the newline character ("\n")

After the service is started, you will see the following output on the console:

Server is running at http://localhost:5001

You can visit http://localhost:5001 to verify that the service is running. If the service is working correctly, you will see the greeting message: "Hello World! This is OpenAI Mock Server."

Usage

AIMock Server provides the following main routes:

  1. /v1/chat/completions - Mocks the chat model completions of OpenAI. Supports both stream and non-stream mode. Accepts POST requests.

  2. /v1/completions - Mocks the text model completions of OpenAI. Supports both stream and non-stream mode. Accepts POST requests.

  3. /v1/images/generations - Mocks the image generation of OpenAI. Accepts POST requests.

You can provide a mockType parameter in the request body to specify the type of mock response. Acceptable mockType values are "random", "echo", or "fixed". The default is "random".

For more detailed API documentation and examples, please refer to the /docs directory in the project.

Contribution

If you find any issues or have any suggestions, feel free to open an issue or submit a pull request.

Credits

This project is inspired by MockAI

License

This project is licensed under the MIT license. For more details, please refer to the LICENSE file.