Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jota-one/drosse

Package Overview
Dependencies
Maintainers
2
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jota-one/drosse

A stateful and programmable mock server

  • 3.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
100
decreased by-4.76%
Maintainers
2
Weekly downloads
 
Created
Source


Drosse

Stateful & programmable mock server

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.

Keywords

FAQs

Package last updated on 15 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc