A qconf tools for nodejs and want to look for a girlfriend...
$ npm i ai-qconf-client
import createQconfHost from 'ai-qconf-client'
import { Qconf } from '@blued-core/qconf'
const qconf = new Qconf(datum)
qconf.flag = isLocalPro ? 'production' : ''
const getQconfHost = (key: string) => {
if (!(key in datum)) {
throw new Error(`Can not find the key: [${key}]`)
}
return createQconfHost({
key,
option: qconf,
path: datum[key].qconf,
})
}
function getTest () {
const result = getQconfHost('charonRedis')
console.log(result)
return result
}
// options
interface Config {
key: string
option: any
path: string
time?: number
}