0.0.3 • Published 9 years ago

meta-config v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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
# }