json2xlsx is not a function
Sreekanth816 opened this issue · 1 comments
Sreekanth816 commented
json2xlsx is not a function
Sreekanth816 commented
Here is my code
var json2xlsx = require('json2xlsx-export');
router.get('/download', function (req, res) {
const config = {
filename: 'AwesomeFile',
sheets: [
{
name: 'Sheet1',
data: [
[{
value: 'Text1',
type: 'string'
},{
value: 'Text2',
type: 'string'
}, {
value: 1000,
type: 'number'
}]
]
},
{
name: 'Sheet2',
data: [
[{
value: 'New text1',
type: 'string'
},{
value: 'New text2',
type: 'string'
}, {
value: 2000,
type: 'number'
}]
]
}
]
};
json2xlsx(config);
});