sheetjs-clone/demos/electron
SheetJS f03e32fc9a updated demos [ci skip]
- frameworks: react, react-native, preact, next.js, weex, nuxt.js
- deployments: nodejs server, duktape, chakra, electron, nw.js
2017-09-12 16:02:06 -04:00
..
index.html updated demos [ci skip] 2017-09-12 16:02:06 -04:00
index.js updated demos [ci skip] 2017-09-12 16:02:06 -04:00
main.js updated demos [ci skip] 2017-09-12 16:02:06 -04:00
Makefile updated demos [ci skip] 2017-09-12 16:02:06 -04:00
package.json updated demos [ci skip] 2017-09-12 16:02:06 -04:00
README.md updated demos [ci skip] 2017-09-12 16:02:06 -04:00

Electron

This library is compatible with Electron and should just work out of the box. The demonstration uses Electron v1.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

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

var dialog = require('electron').remote.dialog;
var o = (dialog.showOpenDialog({ properties: ['openFile'] })||[''])[0];
var workbook = X.readFile(o);