Closed hazemhagrass closed 8 years ago
+1
looks like you have a typo on line 8.
var xls = json2xls(son);
should be:
var xls = json2xls(json);
See comment by @brightloudnoise
For reference, this would be a complete working example:
var json2xls = require('../lib/json2xls');
var fs = require('fs');
var json = {
foo: 'bar',
qux: 'moo',
poo: 123,
stux: new Date()
}
var xls = json2xls(json);
fs.writeFileSync('output.xlsx', xls, 'binary');
Which results in the following excel sheet:
I tried the code in your example:
but unfortunately the file in path is always empty