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

@jota-one/drosse

v3.6.2

Published

A stateful and programmable mock server

Downloads

839

Readme

NPM Version NPM Downloads Package Size Buy Me A Coffee

Drosse is a stateful and programmable mock server written in javascript.

Based on h3, Drosse uses loki to store your mock data in memory so you can modify them in your POST, PUT, PATCH and DELETE requests.

It comes out of the box with all the features you need to completely simulate a backend API, making it the best companion for any frontend developer 🤓

Features

Tight to your project: your mocks and your mock-server are part of your project. You can run as many drosse instances as you want simultaneously.

Easy configuration: configuring drosse is as simple as writing its port number in a .drosserc.js file and writing route definitions in a routes.json file.

Cascading configs: routes are defined as a JSON tree of sub-paths - plugins (throttle, proxy, ...) are inherited by child routes.

Static mocks: write mocks directly in the routes.json file (inline mode) or in JSON files (static mode).

Dynamic mocks: build dynamic responses in javascript and access to the persisted data api, the request object and the NodeJS environment.

Assets handling: serve multimedia files with patterns and wild cards for easy fallback.

Dynamic URL params: match any route/endpoint pattern with dynamic parameters => /api/users/:id.

Data persistence: work with stateful and interactive mocks thanks to the in-memory JSON database accessible via an easy-to-use API.

Throttling: delay response time of your routes, even the proxied ones.

Proxying: super-flexible proxy mechanism with inheritance and overwriting of sub-routes (with different proxy or local route).

Middlewares: extend Drosse with custom express middlewares to fulfill your use cases.

Templates: use response templates to avoid repeating yourself.

Scraping: scrape proxied endpoints and save the content to Drosse's database or static files.

Extensible REPL CLI: build custom commands and execute them at runtime => simulate interaction with 3rp-party services.

Examples

Find example code in the examples folder.

Contact & Support

Development

  • Clone this repository
  • Install yarn globally using npm install -g yarn
  • Install dependencies using yarn
  • Build using yarn build or yarn build:stub for live rebuild
  • Run drosse with yarn serve examples/<example-folder-name>

Credits & License

Drosse is crafted by Jota and licensed under the MIT license.