meta-config
v0.0.3
Published
read config from text file(js, css, html, bash, php) by code comment.
Downloads
4
Readme
meta-config
- 1、从文本文件的注释中读取JSON配置
期待的使用方法
npm install meta-config
require('meta-config')('./index.html', {encoding: 'utf-8', 'meta': 'meta:'});
支持一下几种格式:
*html
<body>
<!--meta:
{
"webpath": "hello",
"t": true,
"a": [
"hello",
"wor\"ld",
true,
false,
10,
0.1
],
"f": false,
"k": 10
}
-->
</body>
- js
/**meta:
* {
* "webpath": "hello",
* "t": true,
* "a": [ "hello", "wor\"ld", true, false, 10, 0.1 ],
* "f": false,
* "k": 10
* }
*/
and
//meta:
// {
// "webpath": "hello2",
// "t": true,
// "a": [ "hello", "wor\"ld", true, false, 10, 0.1 ],
// "f": false,
// "k": 10
// }
shell
#meta:
# {
# "webpath": "OK",
# "t": true,
# "a": [ "hello", "wor\"ld", true, false, 10, 0.1 ],
# "f": false,
# "k": 10
# }