UNPKG

jsdoctoveps

Version:

js -> markdown-> vitepress

18 lines (17 loc) 540 B
const fsExtra = require('fs-extra'); const path = require("path"); /** * jsonData 获取 base_config.json 文件中的配置 * fsExtra.pathExistsSync 校验当前文件是否存在 * fsExtra.readJSONSync 获取文件中的json对象 */ function jsonData() { let data = {}; let filePath = path.join(__dirname, '../../base_config.json'); let isExist = fsExtra.pathExistsSync(filePath); if (isExist) { data = fsExtra.readJSONSync(filePath); } return data; } exports.jsonData = jsonData