Reference articles
http://librajt.github.io/2013/08/04/handle-excel-file-with-nodejs/
compared the Exceljs, Https://github.com/guyonroche/exceljs#create-a-workbook
Node-xlsx, https://github.com/mgcrea/node-xlsx
such as Nodejs and other existing components, decided to use node-xlsx .
node-xlsx based on existing front-end powerful components js-xlsx, https://github.com/SheetJS/js-xlsx
Examples of Use:
var express = require (' Express '); var router = Express. Router (); var xlsx = require (' node-xlsx '); var fs = require (' FS ');/* GET import Excel Test. */router.get ('/importexcel ', function (req, res, next) {var filename= './public/test.xlsx '; console.error (filename);// Read from a Filevar obj = xlsx.parse (filename); Console.log (json.stringify (obj)); Res.send (' Import successfully! '); * GET export Excel test. */router.get ('/exportexcel ', function (req, res, next) {//Writevar data = [[1,2,3],[true, False, NULL, ' Sheetjs '],[' foo ', ' Bar ', New Date (' 2014-02-19t14:30z '), ' 0.3 '], [' Baz ', null, ' Qux ']];var buffer = Xlsx.build ([{name: ' Mysheetname ', data:d ATA}]), Fs.writefilesync (' b.xlsx ', buffer, ' binary '), Res.send (' Export successfully! ');
Add:
File upload operation can choose the following two kinds of
FS Https://github.com/jprichardson/node-fs-extra
formidable
Https://github.com/felixge/node-formidable
Import and export of Excel files with Nodejs processing