【文件属性】:
文件名称:json-compile:json中引用的编译
文件大小:7KB
文件格式:ZIP
更新时间:2021-07-09 13:54:28
JavaScript
- 编译
将给定 json 文件中的引用编译为单个结构
概述
它是关于在您的应用程序中简单继承 json 配置。 它只是找出给定文件中的所有$ref键并用引用的值替换它们。 第一个将替换外部引用(到外部文件),第二个 - 内部引用(以#符号开头)。
例子
想象一下你有基本配置和他的扩展。
// inside /dir/base/extension.json
{
"$ref" : "../base.json" ,
"host" : "127.0.0.1" ,
"port" : "8080"
}
// inside /dir/base.json
{
"name" : "json-compile"
}
在您的程序中,您可以使用json-compile模块获得编译配置:
// inside your program
var compile = requi
【文件预览】:
json-compile-master
----.gitignore(24B)
----package.json(860B)
----src()
--------compile()
--------compile.js(8KB)
----.travis.yml(37B)
----README.md(2KB)
----test()
--------compile.js(2KB)
--------fixtures()