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

elastic-mock

v0.3.0

Published

A lightweight, high-performance, in-memory Elasticsearch mock server backed by FlexSearch.

Readme

elastic-mock

elastic-mock is a lightweight, high-performance, in-memory Elasticsearch mock server designed for integration testing. It emulates the Elasticsearch 8.x REST API, allowing you to test search-driven applications without the overhead of a full Elasticsearch cluster.

Developed and maintained by Gemini and Qwen.

Implementation Status: [COMPLETE]

All core phases of the roadmap have been implemented and verified with a comprehensive suite of integration tests.

  • Indices Management: Creation, deletion, and mapping retrieval.
  • Document CRUD: Indexing, partial updates, and deletion.
  • Search & Query DSL: Full-text match, exact term filtering, and bool logic.
  • Aggregation Engine: terms, avg, min, max, and sum support.
  • Bulk API: High-volume ingestion via NDJSON.
  • CAT APIs: Human-readable stats for indices, nodes, and health.
  • Data Streams: Native support with backing index management and rollover.
  • Machine Learning & Graph: Support for data frame analytics, snapshot upgrades, and graph exploration.
  • Logging: Structured API logging using Winston.

Installation

npm install -g elastic-mock

Usage

Start the Server

Start the mock server on the default port (19200):

elastic-mock

Custom Port

Specify a custom port using the --port flag:

elastic-mock --port 9201

Health Check

Verify the server is running:

curl http://localhost:19200/_cluster/health

Features

  • Elasticsearch 8.x Compatible: Follows the 8.x REST API specification, including mandatory headers.
  • In-Memory Storage: Uses a central Store with JavaScript Map objects. No disk persistence.
  • High Performance: Powered by FlexSearch for fast full-text indexing.
  • Comprehensive Logging: Detailed request/response logging via winston.
  • Developer Friendly: Includes prettier for formatting and a strict CI pipeline.

Testing

The project is verified against both internal test suites and official Elasticsearch client tests.

  • Internal Tests: 30 integration and unit tests passing.
  • External Tests: Verified using the elasticsearch-clients-tests suite.
    • Status: 221 passed, 0 failed.

Development

Detailed design, architecture, and implementation information can be found in the docs/README.md.

Pre-commit Checklist

As defined in AGENTS.md, ensure quality with:

  1. npm run format
  2. npm run build
  3. npm run test (Unit & Integration)
  4. npm run test:external (Official client tests)

License

ISC