const fs = require('fs'); var path = require('path'); var configPath = path.join(__dirname, 'koiFieldList.xml'); var configString = fs.readFileSync(configPath, 'utf8'); var parseString = require('xml2js').parseString; var siteDedicatedList = require("./sourceDedicatedFieldList.json"); function getAllFieldList(callback){ parseString(configString, function (err, result) { if(err) throw err; callback(result); }); } module.exports = { getAllFieldList: getAllFieldList };
我有话说: