-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.js
More file actions
24 lines (18 loc) · 592 Bytes
/
menu.js
File metadata and controls
24 lines (18 loc) · 592 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const fs = require('fs');
fs.readFile('./menu.json', 'utf8', (err, data) => {
if (err) {
console.log(`Error reading file from disk: ${err}`);
} else {
// parse JSON string to JSON object
const items = JSON.parse(data);
//console.log(items.linkList);
// print all databases
items.linkList.forEach(db => {
//console.log(typeof db.items , db.items);
typeof db.items === 'object' && db.items.forEach(menu => {
typeof menu.md === 'string' && console.log(menu.md);
//console.log(`${db.linkList}: ${db.type}`);
});
});
}
});