如何将json中的数据加载到hubot中?

时间:2018-08-11 14:42:39

标签: json coffeescript hubot

我正在编写一个Hubot脚本来回答有关ISO标准的简单问题。当前,它在JSON文件中包含该标准的词汇表,例如:

{"title": "For the purpose of the FitSM family of standards, the following terms and definitions apply",
"version": "2.4",
"license": "cc-by-nd",
"terms": [
  {
    "name": "Accessibility of information",
    "aka": "",
    "description": "Property of information being accessible and usable by an authorized party",
    "section": "5.1",
    "notes": []
  }
]}

包含所有数据的文件位于Hubot加载的咖啡脚本的子目录中,scripts/data/vocab.json

如何告诉Hubot从该文件中的数据创建变量?

0 个答案:

没有答案