Yaml 格式配置全局载入库 confyaml
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/monk3yk1n9/node-confyaml
- 软件文档: https://www.npmjs.com/package/confyaml
- 官方下载: https://github.com/monk3yk1n9/node-confyaml
软件介绍
Yaml格式配置全局载入库,将单个或者多个yaml格式的配置文件映射到系统环境变量中。只需在入口文件中包含confyaml包,就可以在同一项目不同文件中获取配置项,无需多次导入读取yaml文件。
安装
通过npm或者yarn下载
~ npm i --save[-dev] confyaml # or ~ yarn add [--dev] confyaml
使用
config.yaml
app_name: here is app name
tips: config.yaml 文件如果在项目的根目录,那么在入口文件导入如下代码即可。
require("confyaml").config()app.js
// in app.js
require("confyaml").config(); // *default read root directory config.yaml*
// or
require("confyaml").config({path: "./config.yaml"})
// or
require("confyaml").config({
path: [
"./config.yaml",
"./database.yaml"
]
})
// in other files.
console.log(process.env.get("app"))
// -> here is app name
Responsive Web Design
Ethan Marcotte / Happy Cog / 2011-6 / USD 18.00
From mobile browsers to netbooks and tablets, users are visiting your sites from an increasing array of devices and browsers. Are your designs ready? Learn how to think beyond the desktop and craft be......一起来看看 《Responsive Web Design》 这本书的介绍吧!
