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

node-simleak

v0.1.0

Published

A web service simulator in node.js

Readme

simleak

Simleak is a HTTP web service simulator.

Installation

npm install node-simleak

Overview

Simleak is built on top of Connect. It provides a set of features that facilitates web service testing.

  • simulates latency by adding delay to requests
  • simulates maximum througput by appying throttling
  • simulates service errors
  • simulates responses with canned content stored in static files
  • simulates responses with dynamic content with templates
  • proxies requests to remote services
  • caches responses for better supporting of load tests

Usage

  • Starts simleak service
simleak --config <config_file> --log <log_level>

where config defines the plug-in chain and the configuration of each plug-in in the chain. log defines the logging level of the service.

  • Runs tests
make test
  • Generates JS documents
make docs

Configuration

The configuration file is itself a JSON object consists of following sections.

service

This section includes configurations related to general service.

  • local_port
    the port number that simleak service will be listening

  • log_level the service log level

modules

This section defines the modules that the simleak will load at the start-up time. Each module has an *id" which can be referenced later and a path where it can be loaded. simleak provides a few built-in modules as listed below

  • simdelay
  • simthrottle
  • simerror
  • simcache
  • simstatic
  • simdynamic
  • simproxy
  • simutil

To load the built-in modules, prefix the module with # such as #simdelay.

One can load any module by providing its loading path and an unique id. To later reference a method from the module in plugins section, use the notion

#module_id.method_name

plugins

This section defines the plug-ins that the simleak will load to form the request process chain.

There are two types of plug-ins. One type only operates on request and passes the request down the chain. They usually don't generate responses (except for generating error responses). Following built-in plug-ins fall into this category:

  • simdelay
  • simthrottle
  • simerror
  • simcache

The other type of plug-ins are responsible for creating responses. However, it is possible to have more than one of these plug-ins in the chain. For example, one can config simstatic to serve the static contents and simdynamic to serve the dynamic contents. It is necessary to have one of these plug-ins at the very end of the process chain. Following built-in plug-ins fall into this category:

  • simstatic
  • simdynamic
  • simproxy

The order of the plug-ins matters if there are dependencies among plug-ins. For example, the simcache is designed to work with simstatic and simproxy, it needs to be placed in front of either plug-ins in the chain.

An example configuration can be found under /example which is used to simulate MSN AdCenter APIs.

How to write custom plug-in

A simleak plug-in is just a typical Connect middleware that implements one special method.

module.exports.configure = function(config) {

    return function(req, res, next) {
         // implementation here
    };
};   

This method takes a single argument config which is a JSON object defined in the configuration file and returns a process method required by Connect.

simleak provides a few utility methods in simutil. Please refer to the JS documentation for details.

License

MIT License