Files
nexusAI/docs/services/shared.md
2026-04-04 05:22:36 -07:00

19 lines
641 B
Markdown

# Shared Package
**Package:** '@nexusai/shared'
**Location:** 'packages/shared'
## Purpose
Common utilities and configuration used across all NexusAI services
Keeping these here avoids duplicating and ensure consistent behavior
# Exports
### 'getEnv(key, defaultValue?)'
Loads an environment variable by key. If no default is provided and the variable is missing, throws at startup rather than failing later on.
```javascript
const { getEnv } = require('@nexusai/shared');
const PORT = getEnv('PORT', '3002'); // optional — falls back to 3002
const DB = getEnv('SQLITE_PATH'); // required — throws if missing
```