Yaml 格式配置全局载入库 confyaml

码农软件 · 软件分类 · 常用JavaScript包 · 2019-04-04 19:28:32

软件介绍

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

本文地址:https://www.codercto.com/soft/d/2865.html

Head First Python(中文版)

Head First Python(中文版)

巴里(Barry.P.) / 林琪 等 / 中国电力出版社 / 2012-3-1 / 68.00元

你想过可以通过一本书就学会Python吗?《Head First Python(中文版)》超越枯燥的语法和甩法手册,通过一种独特的方法教你学习这种语言。你会迅速掌握Python的基础知识,然后转向持久存储、异常处理、Web开发、SQLite、数据加工和lGoogle App Engine。你还将学习如何为Android编写移动应用,这都要归功于Python为你赋予的强大能力。本书会提供充分并且完备......一起来看看 《Head First Python(中文版)》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

随机密码生成器
随机密码生成器

多种字符组合密码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具