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
+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
#1086[RFC] 应用自定义 4xx 和 5xx 的方案51 comments · 2017-06-21#3180[RFC] 增加单进程启动模式43 comments · 2018-11-09#2723[RFC] egg-bin generate28 comments · 2018-06-22#3127config 支持 kubernetes 等容器化方式21 comments · 2018-10-25#1047Common egg Error Codes18 comments · 2017-06-13#2892[RFC] egg-init refactor17 comments · 2018-08-10#4243[RFC] 关于egg异步加载配置文件的解决方式16 comments · 2020-04-01#3198JSDoc code completion16 comments · 2018-11-14
Discussions
#5785egg v4版本目前是否稳定1 comments · 2026-02-03#5780app/module 目录是什么概念?0 comments · 2026-01-27#5369How do I mock a method globally ?0 comments · 2024-11-25#5344egg-schedule does not handle cronOptions properly1 comments · 2024-07-16#5310egg中进行异常捕获时,能否指定某些错误不被写入日志1 comments · 2024-04-28#5309多进程模式下,动态定时任务的执行问题2 comments · 2024-04-24#5307请问 egg 怎么禁止 http 转发到 https, 我所有的资源请求都在http0 comments · 2024-04-18#5297用yarn start启动的生产环境服务,直接报500错1 comments · 2024-02-20
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