Add initial project documentation
This commit is contained in:
18
docs/services/shared.md
Normal file
18
docs/services/shared.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# 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
|
||||
```
|
||||
Reference in New Issue
Block a user