parse-comments

This commit is contained in:
SheetJS 2023-04-27 05:12:19 -04:00
parent 2462218120
commit b96947e8f4
63 changed files with 425 additions and 234 deletions

@ -19,12 +19,13 @@ Each standalone release script is available at <https://cdn.sheetjs.com/>.
<script lang="javascript" src="https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js"></script>`}
</code></pre>
The `latest` tag references the latest version and updates with each release:
:::info
```html
<!-- use the latest version -->
<script lang="javascript" src="https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js"></script>
```
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
:::warning

@ -44,6 +44,14 @@ import { read, writeFileXLSX } from "xlsx";
The ["Bundlers" demo](/docs/demos/bundler) includes examples for specific
bundler tools.
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
:::warning
Older releases are technically available on the public npm registry as `xlsx`,

@ -40,6 +40,14 @@ yarn add https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</TabItem>
</Tabs>
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
:::warning
Older releases are technically available on the public npm registry as `xlsx`,

@ -25,6 +25,14 @@ script as `xlsx.full.min`.
:::
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
## NetSuite
After downloading the script, it can be referenced directly in `define` calls

@ -22,6 +22,14 @@ After downloading the script, it can be directly referenced with `#include`:
#include "xlsx.extendscript.js"
```
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
For local deployments, the scripts can be placed in the `Scripts` folder. The
path is application-specific.

@ -30,6 +30,14 @@ be reported to the Deno project for further diagnosis.
:::
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
## Encoding support
If Encoding support is required, `cpexcel.full.mjs` must be manually imported:

@ -29,6 +29,14 @@ be reported to the Bun project for further diagnosis.
:::
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::
## Encoding support
If Encoding support is required, `cpexcel.full.mjs` must be manually imported.

@ -3,6 +3,10 @@ pagination_prev: getting-started/index
sidebar_position: 2
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Tutorial
SheetJS presents a simple JS interface that works with "Array of Arrays" and
@ -254,9 +258,6 @@ function Presidents() { return ( <button onClick={async () => {
## Run the Demo Locally
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="browser" label="Web Browser">
@ -305,6 +306,7 @@ hosted (no `file:///` access).
</script>
<body>
```
</TabItem>
<TabItem value="nodejs" label="Command-Line (NodeJS)">
@ -364,9 +366,9 @@ like `axios` presents a similar API for fetching data:
Install the dependencies:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz axios
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz axios`}
</code></pre>
The differences in the script are highlighted below.

@ -28,3 +28,10 @@ read the installation instructions for your use case:
});
})}</ul>
:::info
[Watch the repo](https://git.sheetjs.com/SheetJS/sheetjs) or subscribe to the
[RSS feed](https://git.sheetjs.com/sheetjs/sheetjs/tags.rss) to be notified when
new versions are released!
:::

@ -5,6 +5,8 @@ pagination_next: demos/grid/index
sidebar_position: 1
---
import current from '/version.js';
ReactJS is a JS library for building user interfaces.
This demo tries to cover common React data flow ideas and strategies. React
@ -131,12 +133,12 @@ This demo was last run on 2023 February 28 using `create-react-app@5.0.1` and
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-react
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm start
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm start`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:3000`)
@ -211,12 +213,12 @@ This demo was last run on 2023 February 28 using `create-react-app@5.0.1` and
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-react
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm start
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm start`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:3000`)

@ -5,6 +5,8 @@ pagination_next: demos/grid/index
sidebar_position: 2
---
import current from '/version.js';
VueJS is a JS library for building user interfaces.
This demo covers common VueJS data flow ideas and strategies. Single-File
@ -127,12 +129,12 @@ This demo was last run on 2023 April 06 using `vue@3.2.47`. When running
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-vue
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm run dev
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm run dev`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:5173`)
@ -203,12 +205,12 @@ This demo was last run on 2023 April 06 using `vue@3.2.47`. When running
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-vue
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm run dev
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm run dev`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:5173`)

@ -5,6 +5,7 @@ pagination_next: demos/grid/index
sidebar_position: 3
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
@ -162,13 +163,13 @@ This demo was last run on 2023 February 21 using Angular CLI `15.1.6`
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-angular
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npx @angular/cli analytics disable
npm start
```
npm start`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:4200`)
@ -250,13 +251,13 @@ This demo was last run on 2023 February 21 using Angular CLI `15.1.6`
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-angular
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npx @angular/cli analytics disable
npm start
```
npm start`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:4200`)
@ -590,10 +591,10 @@ curl -o tsconfig.app.json -L https://docs.sheetjs.com/angular/versions/tsconfig.
2) install project and dependencies:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i
npm i -S https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
npm i -S https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
3) start a local server with

@ -5,6 +5,8 @@ pagination_next: demos/grid/index
sidebar_position: 4
---
import current from '/version.js';
Svelte is a JS library for building user interfaces.
This demo tries to cover common Svelte data flow ideas and strategies. Svelte
@ -127,12 +129,12 @@ This demo was last run on 2023 March 08 using `svelte@3.55.1`. When running
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-svelte
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm run dev
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm run dev`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:5173`)
@ -205,12 +207,12 @@ This demo was last run on 2023 March 08 using `svelte@3.55.1`. When running
2) Install the SheetJS dependency and start the dev server:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd sheetjs-svelte
npm install
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm run dev
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm run dev`}
</code></pre>
3) Open a web browser and access the displayed URL (`http://localhost:5173`)

@ -41,8 +41,8 @@ This demo includes all of the support files for the Flash and ActiveX methods.
1) Download the standalone script and shim to a server that will host the demo:
<ul>
<li><a href={`https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js`}>shim.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js`}>xlsx.full.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/dist/shim.min.js`}>shim.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js`}>xlsx.full.min.js</a></li>
</ul>
2) [Download the demo ZIP](pathname:///ie/SheetJSIESupport.zip) to the server.

@ -4,6 +4,8 @@ pagination_prev: demos/frontend/index
pagination_next: demos/net/index
---
import current from '/version.js';
:::note
This demo was last tested on 2023 April 18 with `react-data-grid 7.0.0-beta.28`,

@ -4,6 +4,8 @@ pagination_prev: demos/frontend/index
pagination_next: demos/net/index
---
import current from '/version.js';
:::note
This demo was tested against `vue3-table-lite 1.2.4`, VueJS `3.2.47`, ViteJS

@ -4,6 +4,8 @@ pagination_prev: demos/frontend/index
pagination_next: demos/net/index
---
import current from '/version.js';
:::note
This demo was last tested on 2023 February 07 with the ViteJS+React+TypeScript

@ -4,6 +4,8 @@ pagination_prev: demos/frontend/index
pagination_next: demos/net/index
---
import current from '/version.js';
Various JavaScript UI components provide a more interactive editing experience.
Most are able to interchange with arrays of arrays or arrays of data objects.
This demo focuses on a few open source data grids.

@ -2,6 +2,8 @@
title: HTTP Server Processing
---
import current from '/version.js';
Server-Side JS platforms like NodeJS and Deno have built-in APIs for listening
on network interfaces. They provide wrappers for requests and responses.

@ -2,6 +2,7 @@
title: Browser Automation
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

@ -6,6 +6,8 @@ sidebar_custom_props:
type: bundler
---
import current from '/version.js';
:::note
This demo covers static asset imports. For processing files in the browser, the

@ -4,6 +4,8 @@ pagination_prev: demos/net/index
pagination_next: demos/mobile/index
---
import current from '/version.js';
:::note
This was tested against `next v13.1.1` on 2023 January 14.

@ -4,6 +4,8 @@ pagination_prev: demos/net/index
pagination_next: demos/mobile/index
---
import current from '/version.js';
`@nuxt/content` is a file-based CMS for Nuxt, enabling static-site generation
and on-demand server rendering powered by spreadsheets.

@ -4,6 +4,8 @@ pagination_prev: demos/net/index
pagination_next: demos/mobile/index
---
import current from '/version.js';
:::note
This demo uses ["Base64 Loader"](/docs/demos/static/vitejs#base64-loader)
@ -149,9 +151,9 @@ curl -Lo src/data/pres.numbers https://sheetjs.com/pres.numbers
3) Install the SheetJS library:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
4) Replace `src/pages/index.astro` with the following:

@ -7,6 +7,7 @@ sidebar_custom_props:
summary: React + Native Rendering
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

@ -7,6 +7,8 @@ sidebar_custom_props:
summary: JS + Native Elements
---
import current from '/version.js';
The [NodeJS Module](/docs/getting-started/installation/nodejs) can be imported
from the main entrypoint or any script in the project.
@ -108,9 +110,9 @@ selecting the terminal and entering the key sequence `CTRL + C`
3) From the project folder, install the library:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
4) To confirm the library was loaded, change the title to show the version. The
differences are highlighted.

@ -7,6 +7,8 @@ sidebar_custom_props:
summary: VueJS + Web View
---
import current from '/version.js';
The [NodeJS Module](/docs/getting-started/installation/nodejs) can be imported
from the main entrypoint or any script in the project.
@ -152,11 +154,11 @@ When prompted:
<!-- spellchecker-enable -->
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd SheetJSQuasar
npm i
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
3) Set up Cordova:

@ -7,6 +7,8 @@ sidebar_custom_props:
summary: Native Components + Web View
---
import current from '/version.js';
The [NodeJS Module](/docs/getting-started/installation/nodejs) can be imported
from the main entrypoint or any script in the project.

@ -7,6 +7,8 @@ sidebar_custom_props:
summary: JS + Web View
---
import current from '/version.js';
The [NodeJS Module](/docs/getting-started/installation/nodejs) can be imported
from the main entrypoint or any script in the project.
@ -146,10 +148,10 @@ cd sheetjs-cap
3) Install dependencies:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm i --save @capacitor/core @capacitor/cli @capacitor/filesystem
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm i --save @capacitor/core @capacitor/cli @capacitor/filesystem`}
</code></pre>
4) Create CapacitorJS structure:

@ -7,6 +7,7 @@ sidebar_custom_props:
summary: Embedded Chromium + NodeJS
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

@ -7,6 +7,7 @@ sidebar_custom_props:
summary: Webview + Go Backend
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

@ -7,8 +7,10 @@ sidebar_custom_props:
summary: Webview + Rust Backend
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
The [NodeJS Module](/docs/getting-started/installation/nodejs) can be imported
from JavaScript code.
@ -152,12 +154,12 @@ When prompted:
2) Enter the directory and install dependencies:
```bash
<CodeBlock language="bash">{`\
cd SheetJSTauri
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz
npm i --save @tauri-apps/api
npm i --save-dev @tauri-apps/cli
```
npm i --save-dev @tauri-apps/cli`}
</CodeBlock>
3) Enable operations by adding the highlighted lines to `tauri.conf.json` in
the `tauri.allowlist` section:

@ -7,6 +7,7 @@ sidebar_custom_props:
summary: Native Components with React
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
@ -246,11 +247,11 @@ npx react-native-windows-init --no-telemetry --overwrite
</TabItem>
</Tabs>
Install library:
Install the SheetJS library:
```powershell
npm install --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
To ensure that the app works, launch the app:
@ -453,11 +454,11 @@ Create the MacOS part of the application:
npx react-native-macos-init --no-telemetry
```
Install Library:
Install the SheetJS library:
```
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
To ensure that the app works, launch the app:

@ -7,6 +7,8 @@ sidebar_custom_props:
sql: true
---
import current from '/version.js';
WebSQL is a popular SQL-based in-browser database available on Chrome. In
practice, it is powered by SQLite, and most simple SQLite-compatible queries
work as-is in WebSQL.

@ -98,11 +98,11 @@ function SheetJSAlaSQL() {
The [Standalone scripts](/docs/getting-started/installation/standalone) should
be loaded before the `alasql` script:
```html
<script src="https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js"></script>
<script src="https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/alasql"></script>
```
<pre><code parentName="pre" {...{"className": "language-html"}}>{`\
<script src="https://cdn.sheetjs.com/xlsx-${current}/package/dist/shim.min.js"></script>
<script src="https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/alasql"></script>`}
</code></pre>
#### Frameworks and Bundlers

@ -6,6 +6,8 @@ sidebar_custom_props:
sql: true
---
import current from '/version.js';
:::note
This demo was last tested on 2023 April 19 with Knex 2.4.2 and `better-sqlite`.
@ -37,9 +39,9 @@ const worksheet = XLSX.utils.json_to_sheet(aoo);
1) Install dependencies:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz knex better-sqlite3
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz knex better-sqlite3`}
</code></pre>
2) Download the [test file](https://sheetjs.com/pres.numbers)

@ -6,6 +6,8 @@ sidebar_custom_props:
type: document
---
import current from '/version.js';
MongoDB is a popular document-oriented database engine.
It is straightforward to treat collections as worksheets. Each object maps to

@ -6,6 +6,8 @@ sidebar_custom_props:
type: nosql
---
import current from '/version.js';
Redis has 5 core data types: "String", List", "Set", "Sorted Set", and "Hash".
Since the keys and values are limited to simple strings (and numbers), it is
possible to store complete databases in a single worksheet.
@ -201,10 +203,10 @@ curl -LO https://docs.sheetjs.com/nosql/SheetJSRedisTest.mjs
2) Install dependencies and run:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz redis@4.6.4
node SheetJSRedisTest.mjs
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz redis@4.6.4
node SheetJSRedisTest.mjs`}
</code></pre>
Inspect the output and compare with the data in `SheetJSRedisTest.mjs`.

@ -4,6 +4,8 @@ pagination_prev: demos/local/index
pagination_next: demos/extensions/index
---
import current from '/version.js';
AWS is a Cloud Services platform which includes traditional virtual machine
support, "Serverless Functions", cloud storage and much more.

@ -4,8 +4,10 @@ pagination_prev: demos/local/index
pagination_next: demos/extensions/index
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
This demo uses `node-google-spreadsheet` to interact with Google Sheets v4 API.
@ -28,9 +30,9 @@ covers Apps Script integration.
Install the dependencies:
```bash
npm i https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz google-spreadsheet@3.3.0
```
<CodeBlock language="bash">{`\
npm i -S https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz google-spreadsheet@3.3.0`}
</CodeBlock>
The library README has a [guide](https://theoephraim.github.io/node-google-spreadsheet/#/getting-started/authentication)
for configuring a service worker with write access to the document. Following
@ -73,9 +75,9 @@ should be granted the "Editor" role
2) Install the dependencies:
```
npm i https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz google-spreadsheet@3.3.0
```
<CodeBlock language="bash">{`\
npm i -S https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz google-spreadsheet@3.3.0`}
</CodeBlock>
2) Save the following snippet to `common.js`:
@ -205,9 +207,9 @@ should be granted the "Editor" role
2) Install the dependencies:
```
npm i https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz google-spreadsheet@3.3.0
```
<CodeBlock language="bash">{`\
npm i -S https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz google-spreadsheet@3.3.0`}
</CodeBlock>
2) Save the following snippet to `common.js`:

@ -4,6 +4,8 @@ pagination_prev: demos/local/index
pagination_next: demos/extensions/index
---
import current from '/version.js';
Airtable recommends Personal Access Tokens for interacting with their API. When
fetching data from the API, the result will include an array of row objects that
can be converted to a worksheet with `XLSX.utils.json_to_sheet`. The API methods
@ -13,9 +15,9 @@ to write data will accept row objects generated by `XLSX.utils.sheet_to_json`.
The main module is `airtable` and can be installed with `npm`:
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz airtable
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz airtable`}
</code></pre>
To obtain a reference to a table, code needs a [PAT](#personal-access-token),
the name of the workspace (typically starting with `app`), and the name of the

@ -4,6 +4,8 @@ pagination_prev: demos/local/index
pagination_next: demos/extensions/index
---
import current from '/version.js';
Azure is a Cloud Services platform which includes traditional virtual machine
support, "Serverless Functions", cloud storage and much more.

@ -4,6 +4,9 @@ pagination_prev: demos/local/index
pagination_next: demos/extensions/index
---
import current from '/version.js';
import CodeBlock from '@theme/CodeBlock';
Many official data releases by governments and organizations include XLSX or
XLS files. Unfortunately some data sources do not retain older versions.
@ -109,10 +112,11 @@ data formats. The `readXLSX` helper uses SheetJS under the hood.
The library uses an older version of the SheetJS library. To use the latest
releases, the examples import from the SheetJS CDN:
```ts
// @deno-types="https://cdn.sheetjs.com/xlsx-latest/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-latest/package/xlsx.mjs';
```
<CodeBlock language="ts">{`\
// @deno-types="https://cdn.sheetjs.com/xlsx-${current}/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-${current}/package/xlsx.mjs';`}
</CodeBlock>
The official Deno registry is out of date. This is a known registry bug.
@ -123,30 +127,30 @@ The official Deno registry is out of date. This is a known registry bug.
The first argument to the post-processing script is the filename. The file can
be read with `XLSX.readFile` directly. `XLSX.utils.sheet_to_csv` generates CSV:
```ts title="postprocess.ts"
// @deno-types="https://cdn.sheetjs.com/xlsx-latest/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-latest/package/xlsx.mjs';
<CodeBlock title="postprocess.ts" language="ts">{`\
// @deno-types="https://cdn.sheetjs.com/xlsx-${current}/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-${current}/package/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://cdn.sheetjs.com/xlsx-latest/package/dist/cpexcel.full.mjs';
import * as cptable from 'https://cdn.sheetjs.com/xlsx-${current}/package/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
\n\
/* get the file path for the downloaded file and generate the CSV path */
const in_file = Deno.args[0];
const out_file = in_file.replace(/.xlsx$/, ".csv");
\n\
/* read file */
// highlight-next-line
const workbook = XLSX.readFile(in_file);
\n\
/* generate CSV from first worksheet */
const first_sheet = workbook.Sheets[workbook.SheetNames[0]];
// highlight-next-line
const csv = XLSX.utils.sheet_to_csv(first_sheet);
\n\
/* write CSV */
// highlight-next-line
Deno.writeFileSync(out_file, new TextEncoder().encode(csv));
```
Deno.writeFileSync(out_file, new TextEncoder().encode(csv));`}
</CodeBlock>
## Complete Example
@ -178,28 +182,28 @@ You will be redirected to the new project.
The main panel will show a `postprocess.ts` tab. Copy the following code to
the main editor window:
```ts title="postprocess.ts"
// @deno-types="https://cdn.sheetjs.com/xlsx-latest/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-latest/package/xlsx.mjs';
<CodeBlock title="postprocess.ts" language="ts">{`\
// @deno-types="https://cdn.sheetjs.com/xlsx-${current}/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-${current}/package/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://cdn.sheetjs.com/xlsx-latest/package/dist/cpexcel.full.mjs';
import * as cptable from 'https://cdn.sheetjs.com/xlsx-${current}/package/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
\n\
/* get the file path for the downloaded file and generate the CSV path */
const in_file = Deno.args[0];
const out_file = in_file.replace(/.xlsx$/, ".csv");
\n\
/* read file */
const workbook = XLSX.readFile(in_file);
\n\
/* generate CSV */
const first_sheet = workbook.Sheets[workbook.SheetNames[0]];
const csv = XLSX.utils.sheet_to_csv(first_sheet);
\n\
/* write CSV */
// highlight-next-line
Deno.writeFileSync(out_file, new TextEncoder().encode(csv));
```
Deno.writeFileSync(out_file, new TextEncoder().encode(csv));`}
</CodeBlock>
4) In the left "EXPLORER" panel, double-click just below README.md. A text box

@ -4,6 +4,8 @@ pagination_prev: demos/cloud/index
pagination_next: demos/bigdata/index
---
import current from '/version.js';
:::info
This demo focuses on the JavaScript API included with Excel. For reading and
@ -132,9 +134,9 @@ element with name `bt:String`. Change the `DefaultValue` attribute to `SHEETJS`:
7) Install the SheetJS library in the project
```bash
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</code></pre>
8) Replace `src\functions\functions.js` with the following:

@ -4,6 +4,9 @@ pagination_prev: demos/cloud/index
pagination_next: demos/bigdata/index
---
import current from '/version.js';
import CodeBlock from '@theme/CodeBlock';
:::note
This demo focuses on Google Apps Script custom functions. For external data
@ -36,11 +39,11 @@ This demo was last tested on 2023 April 17.
The `clasp` command line tool can be used to upload the standalone script:
```bash
<CodeBlock language="bash">{`\
npx @google/clasp clone SCRIPT_ID
curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js
npx @google/clasp push
```
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js
npx @google/clasp push`}
</CodeBlock>
Once uploaded, the script `xlsx.full.min.gs` will be added to the project.
@ -137,9 +140,9 @@ and paste in the terminal. Press Enter after pasting the ID.
7) Download the standalone build and move to the project directory:
```bash
curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js`}
</code></pre>
8) Push the project to Apps Script:

@ -4,6 +4,8 @@ pagination_prev: demos/cloud/index
pagination_next: demos/bigdata/index
---
import current from '/version.js';
Open Scripting Architecture (OSA), a built-in feature in macOS introduced in
1993, enables users to communicate with applications with a standardized
language and grammar. macOS releases starting from Yosemite (OSX 10.10) include
@ -144,10 +146,10 @@ data in CSV format.
0) Download the standalone script and test file:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
curl -LO https://sheetjs.com/pres.numbers
curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js
```
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js`}
</code></pre>
<Tabs groupId="osa">
<TabItem value="js" label="JavaScript">

@ -4,6 +4,8 @@ pagination_prev: demos/cloud/index
pagination_next: demos/bigdata/index
---
import current from '/version.js';
:::note
This demo was last tested in 2023 April 22 in Mathematica 13.2.1
@ -54,12 +56,12 @@ This demo was tested in macOS. The path names will differ in other platforms.
1) Create the standalone `xlsx-cli` binary:
```bash
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
cd /tmp
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz exit-on-epipe commander@2
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz exit-on-epipe commander@2
curl -LO https://docs.sheetjs.com/cli/xlsx-cli.js
npx nexe -t 14.15.3 xlsx-cli.js
```
npx nexe -t 14.15.3 xlsx-cli.js`}
</code></pre>
This is discussed in ["Command-line Tools"](/docs/demos/desktop/cli)

@ -4,6 +4,8 @@ pagination_prev: demos/bigdata/index
pagination_next: solutions/input
---
import current from '/version.js';
Duktape is an embeddable JS engine written in C. It has been ported to a number
of exotic architectures and operating systems.
@ -132,16 +134,16 @@ mv duktape-2.7.0/src/*.{c,h} .
1) Download the standalone script, shim and test file:
<ul>
<li><a href={`https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js`}>shim.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js`}>xlsx.full.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/dist/shim.min.js`}>shim.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js`}>xlsx.full.min.js</a></li>
<li><a href="https://sheetjs.com/pres.numbers">pres.numbers</a></li>
</ul>
```bash
curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js
curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js
curl -LO https://sheetjs.com/pres.numbers
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/shim.min.js
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js
curl -LO https://sheetjs.com/pres.numbers`}
</code></pre>
2) Download [`sheetjs.duk.c`](pathname:///duk/sheetjs.duk.c):

@ -4,6 +4,8 @@ pagination_prev: demos/bigdata/index
pagination_next: solutions/input
---
import current from '/version.js';
iOS and MacOS ship with the JavaScriptCore framework for running JS code from
Swift and Objective-C. Hybrid function invocation is tricky, but explicit data
passing is straightforward. The demo shows a standalone Swift sample for MacOS.
@ -127,14 +129,14 @@ cd sheetjswift
1) Download the standalone script and the test file:
<ul>
<li><a href={`https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js`}>xlsx.full.min.js</a></li>
<li><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js`}>xlsx.full.min.js</a></li>
<li><a href="https://sheetjs.com/pres.numbers">pres.numbers</a></li>
</ul>
```bash
curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js
curl -LO https://sheetjs.com/pres.numbers
```
<pre><code parentName="pre" {...{"className": "language-bash"}}>{`\
curl -LO https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js
curl -LO https://sheetjs.com/pres.numbers`}