-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
precise time parse (h/t @Ragearino @MyAddonsDev )
- Loading branch information
1 parent
c02eb14
commit fdbbf2d
Showing
51 changed files
with
414 additions
and
1,479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,6 @@ | ||
# Electron | ||
|
||
This library is compatible with Electron and should just work out of the box. | ||
The demonstration uses Electron 18.2.0. The library is added via `require` from | ||
the renderer process. | ||
|
||
The library 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](http://oss.sheetjs.com/sheetjs/) | ||
|
||
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`. | ||
|
||
The demo project is structured for `electron-forge`: | ||
- `npm start` will start the app. | ||
- `npm run make` will build a standalone app. | ||
|
||
The standalone app was tested on an Intel Mac (`darwin-x64`). | ||
|
||
## 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: | ||
|
||
```js | ||
/* 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); | ||
``` | ||
|
||
## Breaking Changes in Electron | ||
|
||
The first version of this demo used Electron 1.7.5. | ||
|
||
Electron 9.0.0 and later require the preference `nodeIntegration: true` in order | ||
to `require('XLSX')` in the renderer process. | ||
|
||
Electron 12.0.0 and later also require `worldSafeExecuteJavascript: true` and | ||
`contextIsolation: true`. | ||
|
||
Electron 14+ must use `@electron/remote` instead of `remote`. | ||
|
||
|
||
[The new demo](https://docs.sheetjs.com/docs/getting-started/demos/desktop#electron) | ||
includes an improved example and detailed explanations. | ||
|
||
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-xlsx?pixel)](https://github.com/SheetJS/js-xlsx) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.