read the excel file content plugin for egg framework, based on js-xlsx
$ npm i egg-xlsx --save
// {app_root}/config/plugin.js
exports.xlsx = {
enable: true,
package: 'egg-xlsx',
};
// {app_root}/config/config.default.js
exports.xlsx = {
};
see config/config.default.js for more detail.
// {app_root}/app/controller/xlsx.js
const Contrller = require('egg').Controller
class XlsxController extends Contrller {
async index() {
const {ctx, app} = this
const res = await app.xlsx.analysis(ctx)
ctx.body = res
}
}
module.exports = XlsxController
Please open an issue here.