Skip to content
Branch: master
Find file History
SheetJSDev version bump 0.12.7: chrome extension
- `writeFile` support chrome extension (fixes #1051 h/t @atkinsam)
- demo refresh
Latest commit 08bb7e6 Mar 29, 2018
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.eslintrc
Makefile version bump 0.12.7: chrome extension Mar 29, 2018
README.md Electron README cleanup [ci skip] Mar 7, 2018
index.html demo refresh [ci skip] Sep 24, 2017
index.js
main.js
package.json updated demos [ci skip] Sep 12, 2017

README.md

Electron

This library is compatible with Electron and should just work out of the box. The demonstration uses Electron 1.7.5. The library is added via require from the render process. It can also be required from the main process, as shown in this demo to render a version string in the About dialog on OSX.

The standard HTML5 FileReader techniques from the browser apply to Electron. This demo includes a drag-and-drop box as well as a file input box, mirroring the SheetJS Data Preview Live Demo

The core data in this demo is an editable HTML table. The readers build up the table using sheet_to_html (with editable:true option) and the writers scrape the table using table_to_book.

Reading and Writing Files

Since electron provides an fs implementation, readFile and writeFile can be used in conjunction with the standard dialog windows. For example:

/* from app code, require('electron').remote calls back to main process */
var dialog = require('electron').remote.dialog;

/* show a file-open dialog and read the first selected file */
var o = dialog.showOpenDialog({ properties: ['openFile'] });
var workbook = XLSX.readFile(o[0]);

/* show a file-save dialog and write the workbook */
var o = dialog.showSaveDialog();
XLSX.writeFile(workbook, o);

Analytics

You can’t perform that action at this time.