我想问一下。如何设置JSON文件以供使用?就像我用javascript创建了taskList.json文件一样,我也不知道解析数据的下一步是什么。我的代码如下:
{
"project": "temp",
"tasks": [{
"_id": "5",
"view_id": "5bcf473",
"projectname": "5bcf4628b68cb41182c1f5db",
"task_name": "add security",
"view_index": 1,
"created_by": {
"created_by_ref": "ai",
"created_by_name": "Benni",
"created_by_avi": "benn@gmail.com"
},
"assiged_to": {
"assiged_name": "Benni",
"assiged_ref": "sddhf2ef",
"role": "developer"
},
"planned": {
"started": 0,
"end": 0
},
"Smartys": [{
"words": "detail",
"task": "planned_estimated_time",
"secret": "task_details",
"date": 0
}]
}]
}
答案 0 :(得分:0)
只需文件
var json = require('./taskList.json');
,节点将为您解析。