whatisgithub

What is egg-development-stub?

eggjs/egg-development-stub — explained in plain English

Analysis updated 2026-08-05 · repo last pushed 2018-01-10

3JavaScriptAudience · developerComplexity · 2/5DormantSetup · moderate

In one sentence

A plugin for the Egg.js framework that lets developers create lightweight fake versions of services for local development, so they can get instant predictable responses without relying on slow or unbuilt dependencies.

Mindmap

mindmap
  root((repo))
    What it does
      Creates stub services
      Returns instant fake responses
      Auto disabled in production
    Tech stack
      JavaScript
      Egg.js plugin
      Node.js
    Use cases
      Stub slow database calls
      Fake external API responses
      Override specific service methods
    Audience
      Egg.js developers
      Local development workflow
      Non-production testing
    Setup
      Enable plugin in local config
      Create stub folder structure
      Drop in fake service files

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Replace a slow database-fetching service with a stub that instantly returns a fake user profile during local development.

USE CASE 2

Stub out an external API call that is not yet built so you can keep coding the rest of your app.

USE CASE 3

Override only specific methods of a real service while letting the remaining methods behave normally.

What is it built with?

JavaScriptEgg.jsNode.js

How does it compare?

eggjs/egg-development-stubabhagsain/bayut-maps-ratingsabhishek-kumar09/who-is-imposter
Stars333
LanguageJavaScriptJavaScriptJavaScript
Last pushed2018-01-102021-04-12
MaintenanceDormantDormant
Setup difficultymoderatemoderateeasy
Complexity2/52/53/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an existing Egg.js project and involves enabling a plugin plus creating a parallel folder structure for stub files.

So what is it?

This project is a tool for developers working with the Egg.js framework. It lets you create "stubs", lightweight stand-ins for parts of your application like services or external calls, so that during local development you can skip slow or complex operations and get immediate, predictable responses. When you're building an app, your code often needs to talk to databases or external services that might be slow, unreliable, or not yet built. This tool solves that by letting you write a fake version of that service that simply returns a fixed, instant response. You drop these fake files into a specific folder in your project, and the tool automatically swaps the real service for your fake one whenever the app runs in a local development environment. The primary audience is developers using Egg.js who want a smoother local coding experience. For example, if you have a service that normally fetches user data from a live database, you could use this to stub it out so it instantly returns a fake user profile instead. This lets you focus on building the visible parts of your app without waiting on the database to respond or needing real data on hand. Setting it up involves enabling a plugin in a local configuration file and creating a parallel folder structure for your stubs. It's designed strictly for non-production environments, it automatically ignores itself when running in production. Beyond simple fixed responses, the tool offers an advanced mode where your fake service can inherit from the real one, allowing you to override only specific methods while letting the rest behave normally. The README is quite sparse and doesn't detail any notable architectural tradeoffs. It mainly serves as a basic instruction manual for where to place files and how to enable the plugin, leaving the broader context of testing strategy to the developer.

Copy-paste prompts

Prompt 1
I'm using the Egg.js framework and want to set up egg-development-stub to fake out a slow service in my local dev environment. Show me how to enable the plugin and where to place my stub files.
Prompt 2
Help me create a stub for an Egg.js service called UserService that normally fetches from a live database. I want it to return a fake user profile instantly during local development using egg-development-stub.
Prompt 3
I want to use the advanced mode of egg-development-stub to override only one method of my real Egg.js service while keeping the rest of the methods working normally. Walk me through how to set that up.

Frequently asked questions

What is egg-development-stub?

A plugin for the Egg.js framework that lets developers create lightweight fake versions of services for local development, so they can get instant predictable responses without relying on slow or unbuilt dependencies.

What language is egg-development-stub written in?

Mainly JavaScript. The stack also includes JavaScript, Egg.js, Node.js.

Is egg-development-stub actively maintained?

Dormant — no commits in 2+ years (last push 2018-01-10).

How hard is egg-development-stub to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is egg-development-stub for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.