22 |
27 |
Installation 🚀
28 |
29 | Clone or download the Github repo or via npm:
30 |
31 | npm install xlsexport
32 |
33 |
34 |
Usage 👩🔧
35 |
36 | xlsExport is defined as a class, and has to be instantiated with data (objects array) and an optional title.
37 |
38 | var xls = new XlsExport([..., Object], String);
39 |
40 | Since Chromium(v61) supports ES6 Modules, XlsExport is available with 'import' syntax 😎. For older browsers I also include
41 | an ES5 version inside the package.
42 |
43 |
Methods 📖
44 |
45 |
46 | -
47 | exportToXLS(String fileName): convert data and force download of a Excel XLS file.
48 | -
49 | exportToCSV(String fileName): convert data separate by semi-colons and force download of a CSV
50 | file.
51 |
52 |
53 |
fileName parameter is optional, if it's not defined, the file will be named "export.xls".
54 |
55 |
Example 🛫
56 |
57 | import XlsExport from './xls-export.js';
58 |
59 |
var xls = new XlsExport([..., Object], String);
60 |
xls.exportToXLS('export2017.xls');
61 |
xls.exportToCSV('export2017.xls');
62 |
63 |
Todo ✅
64 |
65 |
66 | - Support for node.js
67 | - Support for more formats: .ods, enchance .xls, ...
68 |
69 |
70 |
71 |
85 |