Hello Typescript!

This commit is contained in:
undefined committed 2020-07-07 19:58:21 +08:00
1 parent c9b6412527
commit ba03d7a7bf
98 files changed
+3186 -2616

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import fs from 'fs';
import os from 'os';
import path from 'path';
import { defaults } from 'lodash';
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, {
name: 'hydro',
host: '127.0.0.1',
port: 27017,
username: '',
password: '',
});