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 🙏

© 2024 – Pkg Stats / Ryan Hefner

stubmatic

v5.4.1

Published

Mock HTTP calls without coding. Designed specially for testing and QAs.

Downloads

1,642

Readme

Stubmatic

Mock HTTP calls without coding. Designed specially for testing and testers.

NPM quality Travis ci Build Status Gitter Known Vulnerabilities bitHound Overall Score Code Climate Coverage Status

  1. Installation : $npm install stubmatic -g
  2. Set up repo : $stubmatic init [repo-name]
  3. Start server : $stubmatic [-d <repo-name>]
  4. Help : $stubmatic --help

Important links : Video Tutorial, Wiki, NPM, Demo application, issues, changelogs

Main features

  • Mock HTTP(s) calls. (Hence can mock REST/SOAP web services)
  • Inspect HTTP calls from CLI or log them for more detail.
  • No code. Designed specially for testing and testers.
  • Mock messagepack or Nimn (निम्न) response easily. Write in JSON parse in desirable format.
  • Support SSL certificates.
  • Optional configuration
  • Dynamic response
    • Use Regular Expressions to match a request, capture some part of the request, to decide response file at runtime, to change contents of response at runtime etc.
    • Use Expressions (functions and markers) to display dynamic dates, random number etc.
    • Devide your response into multiple files (called dumps) for readability, reusability, and consistency.
    • Create a response skeleton with DB sets and fill data as per matched request.
    • Delay response for fixed or random time.
  • Send response as a stream (downloadable file)
  • Compress response automatically.
  • Route requests to other server using proxy.
  • Memory and CPU efficient
  • Ready to be used in performance environment
  • And much more like short notations, multiple mapping files, file strategy etc.

Configuration

To install stubmatic, you need to install nodejs and npm first. It is recommanded to be on latest version of both. npm is bundeled with nodejs. Now follow above commands to install stubmatic and to set up a repo.

How to start

Stubmatic works on request response mappings specified in a yaml file. Response contents can be read from body or file attribute of a maping.

-  request:
      url: /stubs/(admin|staff|customer|security)/([0-9]+)/2

   response:
      body: >
        multiple line response
        another line

When a request reaches to stubmatic server, it matches the request against all mappings. Whichever mapping matches first(top to bottom), will be used to serve the response. A complete response can be built with multiple files. It can also have some placeholder to show dynamic data, like date, or some random number or some part from request itself. Stubmatic first process and build complete response then respond back to any HTTP(s) request.

Using regular expression, single mapping can be used to match multiple requests and serve response from different files.

Sample SOAP request mapping

-  request:
     method: POST
     url: /soap-simulator/services/ServiceName
     post: actionName[\s\S]*mobile.([0-9]+)
  response:
     headers:
           content-type: text/xml
     strategy: "first-found"
     files: ["stubs/<% post.1 %>/response.xml","stubs/ServiceName/actionName/default.xml"]

Sample REST request mapping

-  request:
     method: GET
     url: /rest-simulator/services/ServiceName/actionName/([0-9]+)
  response:
     headers:
           content-type: text/xml
     strategy: "first-found"
     files: ["stubs/<% url.1 %>/response.xml","stubs/ServiceName/actionName/default.xml"]

Worth to mention

  • NIMN निम्न : Schema aware object compression. 60% and more compressed than JSON. 40% and more compressed than msgpack.
  • अनुमार्गक (anumargak) : The fastest router for node web servers.
  • imglab : Web based tool to label images for object. So that they can be used to train dlib or other object detectors. You can integrate 3rd party libraries for fast labeling.
  • fast-xml-parser: Transform XML to JS/JSON objects, or Nimn rapidly. Transform back JSON to XML. Work in browser, node package, or CLI. Many options to customize parsing.
  • fast-lorem-ipsum : Generate lorem ipsum words, sentences, paragraph very quickly.
  • Grapes : Flexible Regular expression engine (for java) which can be applied on char stream. (maintainers are needed)

Helpful articles and tutorials