I am currently working on a form that will accept user input and add it to one line of an excel sheet, at the moment I have managed to make an excel sheet using third-party plugins (node-xls to be specific), the problem occurs if I want add another line to excel, it deletes the old record and adds a new one, but does not add data to the next line.
I tried to read excel and then concatenate the buffers and write the file again, but it turns out that it distorts the file and makes it unusable.
How to add data to the end of excel sheet? I'm new to nodejs and buffers
var fs = require('fs'); var NodeXls = require('node-xls'); var tool = new NodeXls(); var xls = tool.json2xls({firstName: "arjun", lastName: "u", dob:"12/3/2008"}, {order:["firstName", "lastName", "dob"]}); fs.appendFile('output.xlsx', xls, 'binary', function(err){ if(err) alert("File is readOnly or is being used by another application, please close it and continue!"); });
source share