You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
491 B
TypeScript
18 lines
491 B
TypeScript
4 years ago
|
import fs from 'fs';
|
||
|
import os from 'os';
|
||
|
import path from 'path';
|
||
|
import { defaults } from 'lodash';
|
||
5 years ago
|
|
||
4 years ago
|
let f = path.resolve(process.cwd(), 'config.json');
|
||
|
if (!fs.existsSync(f)) f = path.resolve(os.homedir(), '.config', 'hydro', 'config.json');
|
||
|
if (!fs.existsSync(f)) f = path.resolve('/config/config.json');
|
||
|
const t = JSON.parse(fs.readFileSync(f).toString());
|
||
|
|
||
|
export default defaults(t, {
|
||
4 years ago
|
name: 'hydro',
|
||
|
host: '127.0.0.1',
|
||
|
port: 27017,
|
||
|
username: '',
|
||
|
password: '',
|
||
4 years ago
|
});
|