()
| 19 | |
| 20 | // Load topics. |
| 21 | const loadTopics = async function () { |
| 22 | try { |
| 23 | let absPath = path.resolve(dataDir, "topics.yml"); |
| 24 | return yaml.safeLoad(await readFile(absPath, "utf8")).topics; |
| 25 | } catch (e) { |
| 26 | console.error(e); |
| 27 | return []; |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | // Load package by name. |
| 32 | const loadPackage = async function (name) { |