Introduction
The electron-egg framework is built on three core packages:
- ee-core — Framework core, providing 100+ APIs for application lifecycle, communication, storage, jobs, and more. Supports dual CJS + ESM module format.
- ee-bin — CLI build tool for development orchestration, bundling, encryption, packaging, and resource management.
- ee-go — Go language support library for building cross-process backends alongside the Electron frontend.
Import Format
ee-core / ee-bin (CJS + ESM)
ee-core and ee-bin output both CommonJS and ES Module formats. Choose based on your project:
javascript
// ESM (recommended for TypeScript projects)
import { ElectronEgg } from 'ee-core';
import { getConfig } from 'ee-core/config';
// CJS (recommended for traditional Electron projects)
const { ElectronEgg } = require('ee-core');
const { getConfig } = require('ee-core/config');Recommendation
For Electron main process projects, CJS is the default and recommended format (bundleConfig.format: 'cjs'). ESM requires all business code (controllers, services, config) to be ESM-compatible.
ee-go
go
import "github.com/wallace5303/ee-go/eapp"
import "github.com/wallace5303/ee-go/econfig"Module Documentation
| Package | Description | Documentation |
|---|---|---|
| ee-core | Framework core — lifecycle, config, communication, storage, jobs, utils, ps | ee-core API |
| ee-bin | CLI tool — dev, build, encrypt, package, icon, updater | ee-bin API |
| ee-go | Go backend — eapp, econfig, ehttp, elog, eos, etask | ee-go API |
ee-core Module Map
| Module | Export Path | Key APIs |
|---|---|---|
| app | ee-core / ee-core/app | ElectronEgg, EventBus, lifecycle events |
| config | ee-core/config | getConfig, setConfig, getAppInfo |
| const | ee-core / ee-core/const | Processes, SocketIO, Events, Receiver |
| controller | ee-core/controller | loadController, getControllers |
| cross | ee-core/cross | Cross, cross.run, cross.kill |
| core | ee-core/core | FileLoader, Timing, loadFile |
| electron | ee-core/electron | electronApp, createMainWindow, loadServer |
| exception | ee-core/exception | loadException |
| loader | ee-core/loader | loadFile, requireFile, execFile, resolveModule |
| log | ee-core/log | logger, coreLogger, createLog |
| message | ee-core/message | ChildMessage, childMessage |
| socket | ee-core/socket | SocketServer, HttpServer, IpcServer |
| storage | ee-core/storage | SqliteStorage |
| jobs | ee-core/jobs | ChildJob, ChildPoolJob, LoadBalancer |
| utils | ee-core/utils | extend, is, helper, json, port, ip |
| ps | ee-core/ps | env, paths, process type checks |
| types | ee-core/types | TypeScript type definitions |
ee-bin Command Map
| Command | Description |
|---|---|
dev | Start development mode |
build | Build frontend + electron + platform packages |
start | Production preview |
exec | Execute custom commands |
move | Copy resources |
encrypt | Code encryption |
clean | Remove encrypted output |
icon | Generate app icons |
updater | Generate incremental updates |
ohos | HarmonyOS resource extraction |
Configuration
All ee-bin commands read from ./cmd/bin.js. See Configuration Types and Default Values for details.
