eggjs /egg

🥚🥚🥚🥚 Born to build better enterprise frameworks and apps with Node.js & Koa. https://codewiki.google/github.com/eggjs/egg

★ 18,991⑂ 1,800👁 453⑃ 1,878● 4,117▤ 179
TypeScriptMITCreated 2016-06-18eggjs.org
Download: v4.2.0v4.2.0 ↓4.2.02026-10-07
+0
Daily
18,991
stars
1,800
forks
453
watchers
1,878
prs
4,117
issues
179
releases

README

English | 简体中文


	













 Features

- Built-in Process Management
- Plugin System
- Framework Customization
- Lots of plugins

 Quickstart

Follow the commands listed below.

bash
$ npm install --global utoo@latest
$ mkdir showcase && cd showcase
$ ut create egg@beta
$ ut install
$ ut run dev
$ open http://localhost:7001


 Node.js =22.18.0 required. Use the latest patch of an active LTS release for production.

 Monorepo Structure

This project is structured as a utoo monorepo with the following packages:

- packages/egg - Main Eggjs framework
- examples/helloworld-commonjs - CommonJS example application
- examples/helloworld-typescript - TypeScript example application
- site - Documentation website

The monorepo uses utoo catalog mode for centralized dependency management, ensuring consistent versions across all packages.

 Development Commands

bash
 Install dependencies for all packages
ut install

 Build all packages
ut run build

 Test all packages
ut run test

 Run specific package commands
ut --filter=egg run test
ut --filter=@examples/helloworld-typescript run dev
ut --filter=site run dev


 Local External Services

Some DAL, ORM, Redis, and ecosystem benchmark paths need local MySQL and Redis services. Start the repository-aligned Docker services before running those tests on a clean machine:

bash
ut run dev:services:start


This starts MySQL 8 and Redis 7, matching the main CI service versions, and creates the databases used by local DAL/ORM/e2e fixtures: test, apple, banana, test_runtime_datasource, test_runtime_dao, test_dal_plugin, test_dal_standalone, cnpmcore, and cnpmcore_unittest.

Useful commands:

bash
ut run dev:services:status
ut run dev:services:stop
ut run dev:services:reset


The default host ports are 127.0.0.1:3306 for MySQL and 127.0.0.1:6379 for Redis. If either port is already used, the start command stops before changing containers. Keep using the existing service if it is compatible with CI, or stop it and run the command again. You can change Docker host ports with EGG_DEV_SERVICES_MYSQL_PORT and EGG_DEV_SERVICES_REDIS_PORT; however, the full DAL/ORM/Redis local test path still expects the default host ports.

Image overrides are available for compatibility checks:

bash
EGG_DEV_SERVICES_MYSQL_IMAGE=mysql:5.7 ut run dev:services:start
EGG_DEV_SERVICES_REDIS_IMAGE=redis:7 ut run dev:services:start


Run ut run dev:services:reset before switching MySQL image families, for example between MySQL 8 and MySQL 5.7, because MySQL data directories are not downgrade-compatible across major versions.

Current hard-coded service assumptions:

- Redis plugin fixtures under plugins/redis/test/fixtures/apps//config. use 127.0.0.1:6379; skipped Redis plugin tests become runnable when that port is available.
- Session Redis fixtures under plugins/session/test/fixtures/redis-session/config/config.default.js use 127.0.0.1:6379.
- DAL runtime tests in tegg/core/dal-runtime/test/DataSource.test.ts and tegg/core/dal-runtime/tes

Top issues

Discussions

Latest release

v4.2.0 v4.2.0 2026-10-07
🎉 Minor Release

This release includes minor version updates for all packages.

 🔄 What's Changed

 fix(release): create releases with the GitHub Actions token by @fengmk2 in https://github.com/eggjs/egg/pull/6067
 docs(site): remove recruitment sections from homepages by @killagu in https://github.com/eggjs/egg/pull/6068
 fix(mock): avoid cluster HTTP port collisions in parallel tests by @killagu in https://github.com/eggjs/egg/pull/6069
 fix(mock): create HTTP server after app is ready by @fengmk2 in https://github.com/eggjs/egg/pull/6071
 chore(status): migrate egg-status into mon

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON