spellcheck

This commit is contained in:
SheetJS 2022-08-25 04:22:28 -04:00
parent 4c92216ebe
commit eb096bf09c
41 changed files with 396 additions and 273 deletions

177
.spelling

@ -1,4 +1,4 @@
# xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com
# SheetJS (C) 2013-present SheetJS -- http://sheetjs.com
SheetJS
sheetjs
docs.sheetjs.com
@ -10,18 +10,19 @@ DocCardList
# Excel-related terms
A1-Style
AutoFilter
BIFF12
BIFF2
BIFF3
BIFF4
BIFF5
BIFF8
BIFF12
CFB
CSV
Chartsheet
Chartsheets
DBF
DIF
DSV
Dialogsheet
Dialogsheets
ECMA-376
@ -51,6 +52,7 @@ SYLK
SpreadsheetML
TSV
TXT
Tooltips
UOS
UOS1
UOS2
@ -76,10 +78,10 @@ WQ3
XLML
XLR
XLS
XLW
XLSB
XLSM
XLSX
XLW
chartsheet
chartsheets
dBASE
@ -103,85 +105,155 @@ tooltips
9.x
APIs
ActiveX
AngularJS
ArrayBuffer
Auth
BOM
Base64
Base64-encoded
Booleans
Browserify
Bundlers
CDN
CEP
CLI
CMS
CORS
CRX
CS6
CapacitorJS
Chakra
ChakraCore
CommonJS
Cordova
DOM
DPI
DataGrid
Deno
Downloadify
Drash
Duktape
ES3
ES5
ES6
ESM
ETH
Ethercalc
ExpressJS
ExtendScript
Fastify
FileReader
GatsbyJS
Goja
HTML
HTML5
HTTP
HTTPS
IE
IE8
IE10
IE11
IE6
IE8
IE9
InDesign
IndexedDB
Integrations
JDK
JS
JSX
JavaScriptCore
JerryScript
Knex
KnockoutJS
LLC
LWC
Lifecycle
LocalStorage
LowDB
Lume
MVC
MVVM
MacOS
MariaDB
Meridiem
MongoDB
MySQL
NPM
NW.js
Nashorn
NativeScript
NestJS
NetSuite
NextJS
NoSQL
NodeJS
Northwind
Nunjucks
Nuxt
NuxtJS
PPI
PhantomJS
Photoshop
PostgreSQL
PowerShell
Preact
QuickJS
R1
R2
R5
R9
RDBMS
README
RESTlets
ReactJS
Redis
RequireJS
Roadmap
Rollup
S3
SDK
SQLite
SSL
SWC
SWF
Schemas
Serverless
SessionStorage
SlimerJS
Snowpack
SuiteScript
SuiteScripts
Suitelets
SystemJS
Tauri
TensorFlow
UI
UI5
URI
UTF-16
UTF-8
UXP
V2
V8
VBScript
VSCodium
Vendoring
Vite
ViteJS
VueJS
VueJS-friendly
WMR
WSL
WebAssembly
WebGL
WebKit
WebSQL
Webpack
XHR
XMLHttpRequest
XP
Xcode
angular-cli
async
axios
bundler
@ -196,8 +268,10 @@ dataset
deduplication
destructuring
disambiguate
disambiguated
embeddable
encodings
esbuild
filesystem
globals
iOS
@ -205,9 +279,12 @@ iWork
javascript
lifecycle
metadata
microcontrollers
middleware
minified
minifier
namespace
natively
node.js
nodejs
npm
parsers
@ -216,78 +293,32 @@ pre-generated
prepend
prepended
programmatically
renderer
repo
runtime
serverless
subfolder
submodule
transpiled
uncheck
unpkg
utils
vendoring
webpack
weex
- demos/altjs/README.md
ChakraCore
Duktape
Goja
Nashorn
QuickJS
- demos/angular/README.md
AngularJS
- demos/angular2/README.md
NativeScript
angular-cli
- demos/array/README.md
WebGL
WebAssembly
dataset
TensorFlow
- demos/database/README.md
Knex
LowDB
MariaDB
MongoDB
MySQL
PostgreSQL
schemaless
schemas
serverless
sideloaded
storages
- demos/extendscript/README.md
Photoshop
InDesign
minifier
- demos/function/README.md
microservice
- demos/headless/README.md
PhantomJS
SlimerJS
subfolder
submodule
superagent
transpile
transpiled
transpiling
uncheck
unidimensional
unminified
unpkg
utils
v4
vendoring
vscode-data-preview
webpack
weex
wkhtmltopdf
- demos/nwjs/README.md
NW.js
- demos/react/README.md
Next.js
Preact
- demos/server/README.md
hapi
- demos/showcase/README.md
vscode-data-preview
- demos/xhr/README.md
axios
superagent
# frontmatter noise
api
csf

@ -12,7 +12,7 @@ serve:
.PHONY: spell
spell:
npx spellchecker-cli -d .spelling -f 'docz/**/*.md*' --no-suggestions
npx spellchecker-cli -q -d .spelling -f 'docz/**/*.md*' --no-suggestions
.PHONY: index
index: readme ## Rebuild site

@ -28,8 +28,8 @@ The `latest` tag references the latest version and updates with each release:
:::warning
A number of CDNs host older versions of the SheetJS libraries. Due to syncing
issues, they are generally out of date.
A number of services host older versions of the SheetJS libraries. Due to
syncing issues, they are generally out of date.
They are known CDN bugs.
@ -105,7 +105,7 @@ importScripts("https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.mi
:::caution
This section refers to imports using `script type="module"`. For imports in
modern projects using Webpack or React or Angular or Vue, the installation is
modern projects using Webpack or React or Angular or VueJS, the installation is
described [in the next section](./frameworks).
:::

@ -111,7 +111,7 @@ The package will be installed and accessible as `xlsx`.
#### CommonJS `require`
By default, the module supports `require` and it will automatically add support
for streams and filesystem access:
for streams and file system access:
```js
var XLSX = require("xlsx");

@ -25,8 +25,12 @@ This demo was built on a "Developer Edition" account. At the time of writing, an
### Create Sample Project and Component
<!-- spellchecker-disable -->
Following the steps in ["Develop in Non-Scratch Orgs"](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.get_started_sfdx_deploy):
<!-- spellchecker-enable -->
```bash
## Login
sfdx force:auth:web:login -d -a LWC-Hub
@ -101,7 +105,7 @@ Click "Save" to activate the page, then click the left arrow to return to Setup.
Click the App Launcher and select "Bolt Solutions" then "SheetJS Demo". You
should see a page like
![SheetForce Demo](pathname:///files/sfinitial.png)
![Demo](pathname:///files/sfinitial.png)
## Adding the Standalone Script

@ -17,7 +17,7 @@ support. Over the years there have been a few different JavaScript platforms:
- "UXP": This is the current Adobe recommendation for new CC extensions.
This demo intends to cover the SheetJS-related parts. General setup as well as
This demo intends to cover parts relevant to SheetJS. General setup as well as
general Adobe considerations are not covered here. A basic familiarity with
extension development is assumed.
@ -122,8 +122,8 @@ XLSX.writeFile(workbook, thisFile.absoluteURI);
<details open><summary><b>Complete Example</b> (click to hide)</summary>
In this example, the script will show a dialog to select an output file. Once
selected, the library will create a new workbook with one worksheet. Cell A1
will be "Author" and cell B1 will be the active Photoshop document Author.
selected, the library will create a new workbook with one worksheet. Cell `A1`
will be "Author" and cell `B1` will be the active Photoshop document Author.
The PS author is available as `activeDocument.info.author`.
This demo was verified in Photoshop CS6 64-bit on Windows 10.

@ -231,7 +231,7 @@ documents, and other simple data files. They enable workflows where the library
generates CSV data for the database to process or where the library parses CSV
files created by the database.
#### Worksheets to CSVs
#### Worksheet to CSV
CSV data can be generated from worksheets using `XLSX.utils.sheet_to_csv`.
@ -243,7 +243,7 @@ const csv = XLSX.utils.sheet_to_json(ws);
const csv_arr = wb.SheetNames.map(n => XLSX.utils.sheet_to_json(wb.Sheets[n]));
```
#### CSVs to Worksheets
#### CSV to Worksheet
`XLSX.read` can read strings with CSV data. It will generate single-sheet
workbooks with worksheet name `Sheet1`.
@ -432,11 +432,11 @@ db.readTransaction(tx =>
);
```
The following demo generates a database with hardcoded SQL statements. Queries
The following demo generates a database with 5 fixed SQL statements. Queries
can be changed in the Live Editor. The WebSQL database can be inspected in the
"WebSQL" section of the "Application" Tab of Developer Tools:
![WebSQL DevTools](pathname:///files/websql.png)
![WebSQL view in Developer Tools](pathname:///files/websql.png)
```jsx live
function SheetQL() {
@ -735,14 +735,6 @@ async function generate_sql(knex, ws, wsname) {
### MongoDB Structured Collections
:::warning MongoDB Relicense
This demo was originally written when MongoDB was licensed under AGPLv3. It was
relicensed in 2018 to the Server-Side Public License. This demo was tested with
the "MongoDB Community Server" and may not work with the "Enterprise" Server.
:::
MongoDB is a popular document-oriented database engine.
It is straightforward to treat collections as worksheets. Each object maps to
@ -782,7 +774,7 @@ It was verified in Node 16.16.0.
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz mongodb
```
2) Start a MongoDB server on localhost (follow official instructions)
2) Start a MongoDB server on `localhost` (follow official instructions)
3) Save the following to `SheetJSMongoCRUD.mjs` (the key step is highlighted):

@ -71,11 +71,11 @@ var workbook = XLSX.read(f.getContents(), {type: "base64"});
`N/file` provides [`file.create`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4223861820.html)
and `file.load` for creating and loading files respectively.
Binary content must be base64-encoded. Fortunately, `XLSX.write` with `base64`
Binary content must be Base64-encoded. Fortunately, `XLSX.write` with `base64`
type will generate compatible Base64 strings:
```js
/* write XLSX workbook as base64 string */
/* write XLSX workbook as Base64 string */
var out = XLSX.write(workbook, { bookType: "xlsx", type: "base64" });
/* create file */
var newfile = file.create({

@ -131,7 +131,7 @@ This can be converted to a SheetJS worksheet using `XLSX.utils.aoa_to_sheet`:
### Generating an XLSB file
`XLSX.writeFile` will write a file in the filesystem:
`XLSX.writeFile` will write a file in the file system:
```js
/* write to SheetJS.xlsb */
@ -235,7 +235,7 @@ includes detailed instructions for running locally.
### Reading the Workbook File
`XLSX.readFile` can read files from the filesystem. The following line reads
`XLSX.readFile` can read files from the file system. The following line reads
`sheetjs.xlsx` from the current directory:
```js

@ -2,6 +2,9 @@
sidebar_position: 7
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Headless Automation
Headless automation involves controlling "headless browsers" to access websites
@ -18,9 +21,9 @@ back to the automation script.
This demo focuses on exporting table data to a workbook. Headless browsers do
not generally support passing objects between the browser context and the
automation script, so the file data must be generated in the browser context
and sent back to the automation script for saving in the filesystem. Steps:
and sent back to the automation script for saving in the file system. Steps:
1) Launch the headless browser and load the target webpage.
1) Launch the headless browser and load the target site.
2) Add the standalone SheetJS build to the page in a `SCRIPT` tag.
@ -37,7 +40,7 @@ This demo exports data from <https://sheetjs.com/demos/table>.
:::note
It is also possible to parse files from the browser context, but parsing from
the automation context is more performant and strongly recommended.
the automation context is more efficient and strongly recommended.
:::
@ -50,6 +53,9 @@ an installer script. Installation is straightforward:
npm i https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz puppeteer
```
<Tabs>
<TabItem value="nodejs" label="NodeJS">
Binary strings are the favored data type. They can be safely passed from the
browser context to the automation script. NodeJS provides an API to write
binary strings to file (`fs.writeFileSync` using encoding `binary`).
@ -94,6 +100,71 @@ const puppeteer = require('puppeteer');
})();
```
This script will generate `SheetJSPuppeteer.xlsb` which can be opened in Excel.
</TabItem>
<TabItem value="deno" label="Deno">
:::caution
Deno Puppeteer is a fork. It is not officially supported by the Puppeteer team.
:::
Installation is straightforward:
```bash
env PUPPETEER_PRODUCT=chrome deno run -A --unstable https://deno.land/x/puppeteer@14.1.1/install.ts
```
Base64 strings are the favored data type. They can be safely passed from the
browser context to the automation script. Deno can decode the Base64 strings
and write the decoded `Uint8Array` data to file with `Deno.writeFileSync`
To run the example, after installing the packages, save the following script to
`SheetJSPuppeteer.ts` and run `deno run -A --unstable SheetJSPuppeteer.js`.
```js title="SheetJSPuppeteer.ts"
import puppeteer from "https://deno.land/x/puppeteer@14.1.1/mod.ts";
import { decode } from "https://deno.land/std/encoding/base64.ts"
/* (1) Load the target page */
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on("console", msg => console.log("PAGE LOG:", msg.text()));
await page.setViewport({width: 1920, height: 1080});
await page.goto('https://sheetjs.com/demos/table');
/* (2) Load the standalone SheetJS build from the CDN */
await page.addScriptTag({ url: 'https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js' });
/* (3) Run the snippet in browser and return data */
const b64 = await page.evaluate(() => {
/* NOTE: this function will be evaluated in the browser context.
`page`, `fs` and `puppeteer` are not available.
`XLSX` will be available thanks to step 2 */
/* find first table */
var table = document.body.getElementsByTagName('table')[0];
/* call table_to_book on first table */
var wb = XLSX.utils.table_to_book(table);
/* generate XLSB and return binary string */
return XLSX.write(wb, {type: "base64", bookType: "xlsb"});
});
/* (4) write data to file */
Deno.writeFileSync("SheetJSPuppeteer.xlsb", decode(b64));
await browser.close();
```
This script will generate `SheetJSPuppeteer.xlsb` which can be opened in Excel.
</TabItem>
</Tabs>
## Playwright
Playwright presents a unified scripting framework for Chromium, WebKit, and

@ -8,8 +8,8 @@ title: Typed Arrays and ML
</head>
Machine learning libraries in JS typically use "Typed Arrays". Typed Arrays are
not JS Arrays! SheetJS expects bona fide JS Arrays. With some data wrangling,
translating between SheetJS worksheets and typed arrays is straightforward.
not JS Arrays! With some data wrangling, translating between SheetJS worksheets
and typed arrays is straightforward.
This demo covers conversions between worksheets and Typed Arrays for use with
[TensorFlow.js](https://js.tensorflow.org/js/) and other ML libraries.
@ -43,7 +43,7 @@ function worksheet_to_csv_url(worksheet) {
}
```
[This demo mirrors TFjs docs](https://js.tensorflow.org/api/latest/#data.csv),
[This demo mirrors `TFjs` docs](https://js.tensorflow.org/api/latest/#data.csv),
fetching [an XLSX export of the example dataset](https://sheetjs.com/data/bht.xlsx).
<details><summary><b>TF CSV Demo using XLSX files</b> (click to show)</summary>
@ -193,7 +193,7 @@ var sepal_lengths = [5.1, 4.9, ...];
var sepal_widths = [3.5, 3, ...];
```
When a 2D tensor can be exported, it will look different from the spreadsheet:
When a `tensor2d` can be exported, it will look different from the spreadsheet:
```js
var data_set_2d = [
@ -292,7 +292,7 @@ var col1 = tensor.slice([0,0], [1,tensor.shape[1]]).flatten();
var col2 = tensor.slice([1,0], [1,tensor.shape[1]]).flatten();
```
For exporting, `stack` can be used to linearize the columns:
For exporting, `stack` can be used to collapse the columns into a linear array:
```js
/* pull data into a Float32Array */

@ -169,9 +169,9 @@ bun bun.js
</details>
## ESBuild
## esbuild
The `xlsx.mjs` source file are written in a subset of ES6 that ESBuild
The `xlsx.mjs` source file are written in a subset of ES6 that `esbuild`
understands and is able to transpile down for older browsers.
Both the `node` and `browser` platforms work out of the box.
@ -339,7 +339,7 @@ node esb.node.js
## Parcel
Parcel Bundler should play nice with SheetJS out of the box.
Parcel should play nice with SheetJS out of the box.
:::warning Parcel Bug
@ -846,7 +846,7 @@ While SystemJS works in NodeJS, the built-in `require` should be preferred.
:::
The NodeJS module entrypoint is `xlsx/xlsx.js` and should be mapped:
The NodeJS module main script is `xlsx/xlsx.js` and should be mapped:
```js
SystemJS.config({

@ -65,7 +65,7 @@ npm run build
npm start
```
If you have [VSCodium](https://vscodium.com/) installed, the folder can be opened with
If [VSCodium](https://vscodium.com/) is installed, the folder can be opened:
```powershell
codium .
@ -111,8 +111,8 @@ The `manifest.xml` should also be updated to reflect the function namespace:
After making the change, save the files. Close the terminal window and the
Excel window (do not save the Excel file). Re-run `npm start`.
In the new Excel window, enter the formula `=SHEETJS.VERSION()` in cell E1. You
should see something similar to the following screenshot:
In the new Excel window, enter the formula `=SHEETJS.VERSION()` in cell `E1`.
You should see something similar to the following screenshot:
![`SHEETJS.VERSION` output](pathname:///files/xlcfversion.png)
@ -201,7 +201,7 @@ var aoa = XLSX.utils.sheet_to_json(ws, {header: 1}); // get data as array of arr
To demonstrate the parsing ability, a Base64-encoded version of the file will
be used. This file contains no binary characters and should "just work". Once
the aforementioned Excel bug is fixed, the non-Base64 version can be used.
the aforementioned Excel bug is fixed, the raw binary files can be used.
This new function should be added to `src\functions\functions.js`:
@ -239,8 +239,8 @@ async function extern() {
After making the change, save the files. Close the terminal window and the
Excel window (do not save the Excel file). Re-run `npm start`.
Enter the formula `=SHEETJS.EXTERN()` in cell D1 and press Enter. Excel should
pull in the data and generate a dynamic array:
Enter the formula `=SHEETJS.EXTERN()` in cell `D1` and press Enter. Excel
should pull in the data and generate a dynamic array:
![`SHEETJS.VERSION` output](pathname:///files/xlcfextern1.png)

@ -67,7 +67,7 @@ demo pages should be downloaded and hosted using a simple HTTP server.
:::
<http://oss.sheetjs.com/sheetjs/ajax.html> uses XMLHttpRequest to download test
files and convert to CSV.
files and convert to CSV
<https://oss.sheetjs.com/sheetjs/> demonstrates reading files with `FileReader`.
@ -108,11 +108,11 @@ input_dom_element.addEventListener('change', handle_fr, false);
`Blob#arrayBuffer` is not supported in IE!
**ActiveX-based Upload**
**ActiveX Upload**
Through the `Scripting.FileSystemObject` object model, a script in the VBScript
scripting language can read from an arbitrary path on the filesystem. The shim
includes a special `IE_LoadFile` function to read binary strings from file. This
scripting language can read from an arbitrary path on the file system. The shim
includes a special `IE_LoadFile` function to read binary data from files. This
should be called from a file input `onchange` event:
```js
@ -136,7 +136,7 @@ approach is embedded in `XLSX.writeFile` and no additional shims are necessary.
**Flash-based Download**
It is possible to write to the file system using a SWF. `Downloadify` library
It is possible to write to the file system using a SWF file. `Downloadify`
implements one solution. Since a genuine click is required, there is no way to
force a download. The safest data type is Base64:
@ -159,7 +159,7 @@ Downloadify.create(element_id, {
});
```
**ActiveX-based Download**
**ActiveX Download**
Through the `Scripting.FileSystemObject` object model, a script in the VBScript
scripting language can write to an arbitrary path on the filesystem. The shim

@ -7,8 +7,8 @@ import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
With the availability of JS engines and the success of server-side runtimes, it
is natural to want command-line tools for various workflows.
With the availability of JS engines and the success of server-side platforms,
it is feasible to build command-line tools for various workflows.
This demo covers a number of strategies for building standalone processors. The
goal is to generate CSV output from an arbitrary spreadsheet file.
@ -63,7 +63,7 @@ deno compile -r --allow-read sheet2csv.ts
## NodeJS
There are a few popular tools for compiling NodeJS scripts to executables.
There are a few popular tools for compiling NodeJS scripts to CLI programs.
The demo script presents a friendly command line interface including flags:

@ -24,7 +24,7 @@ import and export data.
The `sheet_to_json` utility function generates arrays of objects, which is
suitable for a number of libraries. When more advanced shapes are needed,
it is easier to munge the output of an array of arrays.
it is easier to process an array of arrays.
### x-spreadsheet
@ -204,7 +204,7 @@ many additional features including massive data streaming, sorting and styling.
### Tabulator
[Tabulator](http://tabulator.info/docs/5.3/download#xlsx) includes deep support
through a special Export button. It handles the SheetJS-related operations.
through a special Export button. It handles the SheetJS operations internally.
### Angular UI Grid
@ -223,7 +223,7 @@ The [AngularJS demo](./legacy#angularjs) covers more general strategies.
<details><summary><b>Notes</b> (click to show)</summary>
The library does not provide any way to modify the import button, so the demo
includes a simple directive for a HTML File Input control. It also includes a
includes a simple directive for a File Input HTML element. It also includes a
sample service for export which adds an item to the export menu.
The demo `SheetJSImportDirective` follows the prescription from the README for
@ -276,7 +276,7 @@ export default function App() {
```
The most generic data representation is an array of arrays. To sate the grid,
the columns must be objects whose `key` property is the stringified number:
columns must be objects whose `key` property is the index converted to string:
```ts
import { WorkSheet, utils } from 'xlsx';
@ -314,11 +314,15 @@ function rdg_to_ws(rows: Row[]): WorkSheet {
}
```
<!-- spellchecker-disable -->
#### RDG Demo
<!-- spellchecker-enable -->
<details><summary><b>Complete Example</b> (click to show)</summary>
1) Create a new TypeScript CRA app:
1) Create a new TypeScript `create-react-app` app:
```bash
npx create-react-app sheetjs-cra --template typescript
@ -333,7 +337,7 @@ npm i -S https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz react-data-grid
3) Replace the contents of `src/App.tsx` with the following code. Note: a copy
to clipboard button will show up if you move your mouse over the code. The
notable SheetJS-specific code is highlighted below:
notable SheetJS integration code is highlighted below:
```tsx title="src/App.tsx"
import React, { useEffect, useState, ChangeEvent } from "react";
@ -444,8 +448,8 @@ export default function App() {
}
```
4) run `npm start`. When you load the dev page in the browser, it will attempt
to fetch <https://sheetjs.com/pres.numbers> and load the data.
4) run `npm start`. When you load the page in the browser, it will attempt to
fetch <https://sheetjs.com/pres.numbers> and load the data.
The following screenshot was taken from the demo:
@ -453,8 +457,12 @@ The following screenshot was taken from the demo:
</details>
<!-- spellchecker-disable -->
### vue3-table-lite
<!-- spellchecker-enable -->
:::note
This demo was tested against `vue3-table-lite 1.2.4`, VueJS `3.2.37`, ViteJS
@ -462,14 +470,13 @@ This demo was tested against `vue3-table-lite 1.2.4`, VueJS `3.2.37`, ViteJS
:::
[`vue3-table-lite`](https://vue3-lite-table.vercel.app/) is a data grid built
for Vue
[`vue3-table-lite`](https://vue3-lite-table.vercel.app/) is a VueJS data grid.
[A complete example is included below.](#vte-demo)
[A complete example is included below.](#vuejs-demo)
#### Rows and Columns Bindings
`vue3-table-lite` presents two bindable attributes: an array of column metadata
`vue3-table-lite` presents two attribute bindings: an array of column metadata
(`columns`) and an array of objects representing the displayed data (`rows`).
Typically both are `ref` objects:
@ -493,7 +500,7 @@ const columns = ref<Column[]>([]);
</template>
```
These can be mutated through the `value` property in Vue lifecycle methods:
These can be mutated through the `value` property in VueJS lifecycle methods:
```ts
import { onMounted } from "vue";
@ -504,7 +511,7 @@ onMounted(() => {
```
The most generic data representation is an array of arrays. To sate the grid,
the columns must be objects whose `field` property is the stringified number:
columns must be objects whose `field` property is the index converted to string:
```js
import { ref } from "vue";
@ -548,11 +555,11 @@ function vte_to_ws(rows) {
}
```
#### VTE Demo
#### VueJS Demo
<details><summary><b>Complete Example</b> (click to show)</summary>
1) Create a new ViteJS App using the Vue + TypeScript template:
1) Create a new ViteJS App using the VueJS + TypeScript template:
```bash
npm create vite@latest sheetjs-vue -- --template vue-ts
@ -575,7 +582,7 @@ curl -LO https://docs.sheetjs.com/vtl/App.vue
cd ..
```
4) run `npm run dev`. When you load the dev page in the browser, it will try
to fetch <https://sheetjs.com/pres.numbers> and load the data.
4) run `npm run dev`. When you load the page in the browser, it will try to
fetch <https://sheetjs.com/pres.numbers> and load the data.
</details>

@ -15,7 +15,7 @@ This library is compatible with Chrome and Chromium extensions and should just
work out of the box. Specific API support is listed in the Chrome extensions
API documentation.
[Right-Click and download the final crx](pathname:///chromium/SheetJSDemo.crx)
[Right-Click and download the final CRX](pathname:///chromium/SheetJSDemo.crx)
:::caution

@ -5,12 +5,12 @@ title: Desktop Applications
Web technologies like JavaScript and HTML have been adapted to the traditional
app space. Typically these frameworks bundle a JavaScript engine as well as a
windowing framework. SheetJS is compatible with many toolkits.
windowing framework. SheetJS is compatible with many app frameworks.
## NW.js
The [Standalone scripts](../getting-started/installation/standalone) can be referenced in a
`SCRIPT` tag from the entry point HTML page.
The [Standalone scripts](../getting-started/installation/standalone) can be
referenced in a `SCRIPT` tag from the entry point HTML page.
This demo was tested against NW.js 0.66.0.
@ -151,7 +151,7 @@ The demo project is wired for `electron-forge` to build the standalone binary.
1) Download the demo files:
- [`package.json`](pathname:///electron/package.json) : project structure
- [`main.js`](pathname:///electron/main.js) : entrypoint
- [`main.js`](pathname:///electron/main.js) : main process script
- [`index.html`](pathname:///electron/index.html) : window page
- [`index.js`](pathname:///electron/index.js) : script loaded in render context
@ -186,7 +186,7 @@ For a recent Intel Mac, the path will be `out/sheetjs-electron-darwin-x64/`
### Writing Files
[`XLSX.writeFile`](../api/write-options) writes workbooks to the filesystem.
[`XLSX.writeFile`](../api/write-options) writes workbooks to the file system.
`showSaveDialog` shows a Save As dialog and returns the selected file name:
```js
@ -282,7 +282,7 @@ document.getElementById("drop").addEventListener("drop", handleDrop, false);
**Electron API**
[`XLSX.readFile`](../api/parse-options) reads workbooks from the filesystem.
[`XLSX.readFile`](../api/parse-options) reads workbooks from the file system.
`showOpenDialog` shows a Save As dialog and returns the selected file name.
Unlike the Web APIs, the `showOpenDialog` flow can be initiated by app code:
@ -343,20 +343,20 @@ Electron 12.0.0 and later also require `worldSafeExecuteJavascript: true` and
`contextIsolation: true`.
Electron 14+ must use `@electron/remote` instead of `remote`. An `initialize`
call is required to enable DevTools in the window.
call is required to enable Developer Tools in the window.
:::
## Tauri
The [NodeJS Module](../getting-started/installation/nodejs) can be imported
from frontend code.
from JavaScript code.
This demo was tested against Tauri 1.0.5 on 2022 August 13.
:::note
Tauri currently does not provide NodeJS-esque `fs` wrapper functions. The raw
Tauri currently does not provide the equivalent of NodeJS `fs` module. The raw
`@tauri-apps/api` methods used in the examples are not expected to change.
:::
@ -396,7 +396,7 @@ When prompted:
- Window Title: `SheetJS + Tauri`
- UI recipe: `create-vite`
- Add "@tauri-apps/api": `Y`
- Vite template: `vue-ts`
- ViteJS template: `vue-ts`
2) Enter the directory:

@ -8,12 +8,12 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
The most popular JavaScript engine is V8. Designed for embedding in software,
it powers Chrome, NodeJS, UXP, Deno and many other platforms and runtimes.
it powers Chrome, NodeJS, UXP, Deno and many other platforms.
There are many other runtimes with different design goals. Some are designed
There are many other JS engines with different design goals. Some are designed
for low-power or low-memory environments. Others aim for interoperability with
specific programming languages or environments. Typically they support a
superset of ES3 and are capable of running SheetJS code.
specific programming languages or environments. Typically they support ES3 and
are capable of running SheetJS code.
## General Caveats
@ -40,9 +40,9 @@ var console = { log: function(x) { print(x); } };
**Binary Data**
Some engines do not provide easy ways of marshalling binary data. For example,
it is common to pass null-terminated arrays, which would truncate XLSX and XLS
files. APIs that accept pointers without length should be avoided.
Some engines do not provide easy ways to exchange binary data. For example, it
is common to pass null-terminated arrays, which would truncate XLSX, XLS, and
other exports. APIs that accept pointers without length should be avoided.
Base64 strings are safe for passing between JS and native code, but they should
only be used when there is no safe way to pass `ArrayBuffer` or `Uint8Array`.
@ -81,7 +81,7 @@ duk_pop(ctx);
:::note
This demo was tested on MacOS x64.
This demo was tested on Intel Mac (`darwin-x64`).
:::
@ -256,7 +256,7 @@ wb, _ = vm.RunString("wb = XLSX.read(buf, {type:'buffer'});")
`"base64"` strings can be decoded in Go:
```go
/* write to base64 string */
/* write to Base64 string */
b64str, _ := vm.RunString("XLSX.write(wb, {type:'base64', bookType:'xlsx'})")
/* pull data back into Go and write to file */
@ -430,7 +430,7 @@ cat global.js xlsx.full.min.js payload.js hermes.js > xlsx.hermes.js
```
The final script defines `global` before loading the standalone library. Once
ready, it will read the hardcoded test file and print the contents as CSV.
ready, it will read the bundled test data and print the contents as CSV.
5) Run the script using the Hermes standalone binary:
@ -461,7 +461,7 @@ Binary strings can be passed back and forth using `String.Encoding.isoLatin1`.
`String(contentsOf:encoding:)` reads from a path and returns an encoded string:
```swift
/* read sheetjs.xls as base64 string */
/* read sheetjs.xls as Base64 string */
let file_path = shared_dir.appendingPathComponent("sheetjs.xls");
let data: String! = try String(contentsOf: file_path, encoding: String.Encoding.isoLatin1);
```
@ -478,8 +478,8 @@ context.evaluateScript("var wb = XLSX.read(payload, {type:'binary'});");
**Writing data**
When writing to binary string in JSC, the result should be stored in a variable
and stringified in Swift:
When writing to binary string in JavaScriptCore, the result should be stored in
a variable and converted to string in Swift:
```swift
/* write to binary string */
@ -618,7 +618,7 @@ cat global.js xlsx.full.min.js payload.js jerry.js > xlsx.jerry.js
```
The final script defines `global` before loading the standalone library. Once
ready, it will read the hardcoded test file and print the contents as CSV.
ready, it will read the bundled test data and print the contents as CSV.
5) Run the script using the `jerry` standalone binary:
@ -834,7 +834,7 @@ cat global.js xlsx.full.min.js payload.js chakra.js > xlsx.chakra.js
```
The final script defines `global` before loading the standalone library. Once
ready, it will read the hardcoded test file and print the contents as CSV.
ready, it will read the bundled test data and print the contents as CSV.
5) Run the script using the ChakraCore standalone binary:

@ -68,7 +68,7 @@ The following table lists tested file plugins. "OS" lists tested platforms
("A" for Android and "I" for iOS). "Copy" indicates whether an explicit copy
is needed (file picker copies to cache directory and file plugin reads cache).
| Filesystem Plugin | File Picker Plugin | OS | Copy |
| File system Plugin | File Picker Plugin | OS | Copy |
|:---------------------------|:-------------------------------|:----:|:-----|
| `react-native-file-access` | `react-native-document-picker` | `AI` | |
| `react-native-blob-util` | `react-native-document-picker` | `AI` | YES |
@ -165,7 +165,7 @@ const wb = XLSX.read(new Uint8Array(res), {type:'buffer'});
:::caution
On iOS, URIs from `react-native-document-picker` must be massaged:
On iOS, the URI from `react-native-document-picker` must be massaged:
```js
import { pickSingle } from 'react-native-document-picker';
@ -218,7 +218,7 @@ import * as XLSX from "xlsx";
import { FileSystem } from "react-native-file-access";
const b64 = await FileSystem.readFile(path, "base64");
/* b64 is a base64 string */
/* b64 is a Base64 string */
const workbook = XLSX.read(b64, {type: "base64"});
```
@ -230,7 +230,7 @@ import { Dirs, FileSystem } from "react-native-file-access";
const DDP = Dirs.DocumentDir + "/";
const b64 = XLSX.write(workbook, {type:'base64', bookType:"xlsx"});
/* b64 is a base64 string */
/* b64 is a Base64 string */
await FileSystem.writeFile(DDP + "sheetjs.xlsx", b64, "base64");
```
@ -270,7 +270,7 @@ await writeFile(DocumentDirectoryPath + "/sheetjs.xlsx", bstr, "ascii");
:::caution
Some Expo APIs return URIs that cannot be read with `expo-file-system`. This
Some Expo APIs return URI that cannot be read with `expo-file-system`. This
will manifest as an error:
> Unsupported scheme for location '...'
@ -305,7 +305,7 @@ import * as XLSX from "xlsx";
import * as FileSystem from 'expo-file-system';
const b64 = XLSX.write(workbook, {type:'base64', bookType:"xlsx"});
/* b64 is a base64 string */
/* b64 is a Base64 string */
await FileSystem.writeAsStringAsync(FileSystem.documentDirectory + "sheetjs.xlsx", b64, { encoding: FileSystem.EncodingType.Base64 });
```
@ -326,9 +326,9 @@ are not covered here.
This example tries to separate the library-specific functions.
0) **Follow the official React Native CLI Quickstart!**
0) **Follow the official React Native CLI Guide!**
Quickstart URL: <http://reactnative.dev/docs/environment-setup>
Development Environment Guide: <http://reactnative.dev/docs/environment-setup>
Follow the instructions for iOS and for Android. They will cover installation
and system configuration. By the end, you should be able to run the sample app
@ -587,7 +587,7 @@ pod install
cd ..
```
After doing this, the simulator must be stopped and the dev server must reload:
Once refreshed, the development process must be restarted:
```bash
npx react-native run-ios
@ -625,7 +625,7 @@ find ~/Library/Developer/CoreSimulator -name sheetjsw.xlsx |
while read x; do echo "$x"; npx xlsx-cli "$x"; done
```
Once testing is complete, stop the simulator and the dev process.
Once testing is complete, stop the simulator and the development process.
**Android Testing**
@ -674,7 +674,7 @@ on an iPhone SE 3rd generation.
:::warning Binary Data issues
NativeScript will not safely transmit binary or UTF8 strings. XLSB, NUMBERS,
NativeScript will not safely transmit binary or UTF-8 strings. XLSB, NUMBERS,
XLSX, XLS, ODS, SYLK, and DBF exports are known to be mangled.
[This is a known NativeScript bug](https://github.com/NativeScript/NativeScript/issues/9586)
@ -731,7 +731,7 @@ await file.writeText(bstr, encoding.ISO_8859_1);
### Demo
The demo builds off of the NativeScript + Angular example. Familiarity with
with Angular and TypeScript is assumed.
Angular and TypeScript is assumed.
<details><summary><b>Complete Example</b> (click to show)</summary>
@ -1088,7 +1088,7 @@ window.requestFileSystem(window.PERSISTENT, 0, function(fs) {
### Demo
The demo builds off of the Vite example. Familiarity with VueJS and TypeScript
The demo draws from the ViteJS example. Familiarity with VueJS and TypeScript
is assumed.
<details><summary><b>Complete Example</b> (click to show)</summary>
@ -1107,6 +1107,8 @@ npm i -g @quasar/cli cordova
npm init quasar
```
<!-- spellchecker-disable -->
When prompted:
- "What would you like to build?": `App with Quasar CLI`
@ -1125,6 +1127,8 @@ When prompted:
2) Install dependencies:
<!-- spellchecker-enable -->
```bash
cd SheetJSQuasar
npm i
@ -1166,7 +1170,7 @@ Return to the project directory:
cd ..
```
4) Start the dev server:
4) Start the development server:
```bash
quasar dev -m ios
@ -1174,7 +1178,8 @@ quasar dev -m ios
:::caution
If the app is blank, delete the app and close the simulator, then restart dev
If the app is blank or not refreshing, delete the app and close the simulator,
then restart the development process.
:::
@ -1228,7 +1233,7 @@ The app should now show two buttons at the bottom:
:::caution
If the app is blank or not refreshing, delete the app and close the simulator,
then restart the dev process.
then restart the development process.
:::
@ -1372,7 +1377,7 @@ id,content
:::note
This demo was tested on an Intel Mac on 2022 August 18 with Cordova backend.
This demo was tested on an Intel Mac on 2022 August 18 with Cordova.
The file integration uses `@ionic-native/file` version `5.36.0`.
The iOS simulator runs iOS 15.5 on an iPod Touch 7th Gen.

@ -5,7 +5,7 @@ title: VueJS
[VueJS](https://vuejs.org/) is a JS library for building user interfaces.
This demo tries to cover common Vue data flow ideas and strategies. Single-File
This demo covers common VueJS data flow ideas and strategies. Single-File
Components (SFC) and VueJS familiarity is assumed.
Other demos cover general VueJS deployments, including:
@ -163,8 +163,8 @@ generate column headings and for indexing into the row objects.
The safest approach is to use an array of arrays for state and to generate
column objects that map to A1-Style column headers.
The [Vue Table Lite demo](./grid#rows-and-columns-bindings) uses this approach
with the following column and row structure:
The [`vue3-table-lite` demo](./grid#rows-and-columns-bindings) generates rows
and columns objects with the following structure:
```js
/* rows are generated with a simple array of arrays */

@ -20,9 +20,9 @@ Other demos cover general Angular deployments, including:
:::warning
Angular dev tooling uses native NodeJS modules. There are a number of issues
when trying to run Angular projects with different NodeJS versions. These
issues should be directed to the Angular project.
Angular tooling uses native NodeJS modules. There are a number of issues when
trying to run Angular projects with different NodeJS versions. These issues
should be directed to the Angular project.
:::

@ -93,7 +93,7 @@ var XLSX = require('xlsx');
exports.handler = function(event, context, callback) {
/* make workbook */
var wb = XLSX.read("S,h,e,e,t,J,S\n5,4,3,3,7,9,5", {type: "binary"});
/* write to XLSX file in base64 encoding */
/* write to XLSX file in Base64 encoding */
// highlight-next-line
var body = XLSX.write(wb, {type:"base64", bookType: "xlsx"});