https://github.com/cuarti/zenox-config
Config engine for Zenox Framework
https://github.com/cuarti/zenox-config
config javascript nodejs typescript zenox zenox-framework
Last synced: about 2 months ago
JSON representation
Config engine for Zenox Framework
- Host: GitHub
- URL: https://github.com/cuarti/zenox-config
- Owner: cuarti
- License: mit
- Created: 2017-03-23T22:57:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T23:04:01.000Z (over 7 years ago)
- Last Synced: 2025-06-20T17:55:16.722Z (about 1 year ago)
- Topics: config, javascript, nodejs, typescript, zenox, zenox-framework
- Language: TypeScript
- Homepage:
- Size: 108 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zenox-config
Library to load configuration data from YAML files depending of NODE_ENV value.
### Default config from YAML files
Default config service that loads config from YAML files with path of one of next options:
- ZENOX_CONFIG_DIR env variable.
- ZENOX_PROJECT_DIR env variable plus "config" child.
- Current working directory plus "config" child.
###### Usage
```typescript
import {Config} from '@zenox/config';
let port = Config.get('http.port');
```
### Custom config from object literal
Custom config service that loads config from object literal.
###### Usage
```typescript
import {ConfigService} from '@zenox/config';
let config = new ConfigService({http: {port: 3000}});
let port = config.get('http.port');
```
### Custom config from YAML files
Custom config service that loads config from path of directory with YAML files.
###### Usage
```typescript
import {ConfigService} from '@zenox/config';
let path = '';
let config = ConfigService.fromYaml(path);
let port = config.get('http.port');
```