1.0.40 • Published 2 years ago

@kenote/config v1.0.40

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

@kenote/config

Get profile module

NPM Version NPM Downloads Gratipay

使用方法

data/config.yaml

host: localhost

port: 3000

site_name: 站点名称

redis:
  host: 127.0.0.1
  port: 6379
  db: 0

data/index.js

module.exports = {
  a: 1
}

app.ts

import { loadConfig, asyncRequire } from '@kenote/config'

/**
 * 读取配置文件
 */
const config = loadConfig('data')
/**
 * 异步导入JS
 */
const ct = asyncRequire('./data')

MIT License.