diff --git a/.spelling b/.spelling
index 57fe27a..1882c3e 100644
--- a/.spelling
+++ b/.spelling
@@ -8,6 +8,7 @@ pagination_prev
pagination_next
TabItem
DocCardList
+CodeBlock
# frontmatter noise
api
@@ -158,8 +159,10 @@ ES5
ES6
ESM
ETH
+Eleventy
Endian
Ethercalc
+ExecJS
ExpressJS
ExtendScript
Fastify
@@ -168,6 +171,7 @@ FileReaderSync
FileSaver
GBK
GatsbyJS
+GitHub
GitLab
Goja
GraphQL
@@ -239,6 +243,7 @@ R9
RDBMS
README
RESTlets
+RSS
ReactJS
Redis
RequireJS
@@ -259,6 +264,7 @@ Snowpack
SuiteScript
SuiteScripts
Suitelets
+SvelteKit
SystemJS
Tauri
TensorFlow
diff --git a/docz/docs/02-getting-started/01-installation/01-standalone.mdx b/docz/docs/02-getting-started/01-installation/01-standalone.mdx
index 45e30ff..3195f50 100644
--- a/docz/docs/02-getting-started/01-installation/01-standalone.mdx
+++ b/docz/docs/02-getting-started/01-installation/01-standalone.mdx
@@ -7,17 +7,18 @@ sidebar_custom_props:
---
import current from '/version.js';
+import CodeBlock from '@theme/CodeBlock';
# Standalone Browser Scripts
Each standalone release script is available at
The current version is {current} and can be referenced as follows:
-{`\
+{`\
`}
-
+
:::info
@@ -43,10 +44,10 @@ They are known CDN bugs.
`xlsx.full.min.js` is the complete standalone script. It includes support for
reading and writing many spreadsheet formats.
-{`\
+{`\
`}
-
+
A slimmer build is generated at `dist/xlsx.mini.min.js`. Compared to full build:
@@ -59,10 +60,10 @@ A slimmer build is generated at `dist/xlsx.mini.min.js`. Compared to full build:
Replace references to `xlsx.full.min.js` with `xlsx.mini.min.js`. Starting from
scratch, a single script tag should be added at the top of the HTML page:
-{`\
+{`\
`}
-
+
@@ -72,16 +73,16 @@ For broad compatibility with JavaScript engines, the library is written using
ECMAScript 3 language dialect. A "shim" script provides implementations of
functions for older browsers and environments.
-{`\
+{`\
importScripts("https://cdn.sheetjs.com/xlsx-${current}/package/dist/shim.min.js");
importScripts("https://cdn.sheetjs.com/xlsx-${current}/package/dist/xlsx.full.min.js");`}
-
+
## ECMAScript Module Imports
@@ -114,42 +115,42 @@ described [in the next section](/docs/getting-started/installation/frameworks).
The ECMAScript Module build is saved to `xlsx.mjs` and can be directly added to
a page with a `script` tag using `type="module"`:
-{`\
+{`\
`}
-
+
If Encoding support is required, `cpexcel.full.mjs` must be manually imported:
-{`\
+{`\
`}
-
+
Dynamic imports with `import()` can be used in data export scenarios. This
example will download the library only when the export button is pressed:
-{`\
+{`\
`}
-
+
Web Worker support is noted in [the demo](/docs/demos/bigdata/worker#installation)
@@ -164,8 +165,8 @@ Bower is deprecated and the maintainers recommend using other tools.
The Bower package manager plays nice with the CDN tarballs:
-{`\
+{`\
npx bower install https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
Bower will place the standalone scripts in `bower_components/js-xlsx/dist/`
diff --git a/docz/docs/02-getting-started/01-installation/02-frameworks.md b/docz/docs/02-getting-started/01-installation/02-frameworks.md
index fdd1437..3582658 100644
--- a/docz/docs/02-getting-started/01-installation/02-frameworks.md
+++ b/docz/docs/02-getting-started/01-installation/02-frameworks.md
@@ -18,21 +18,21 @@ Each standalone release package is available at {`\
+{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
pnpm install https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
yarn add https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
npm rm --save xlsx
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
pnpm rm xlsx
pnpm install https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
yarn remove xlsx
yarn add https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
https://cdn.sheetjs.com/xlsx-{current}/xlsx-{current}.tgz is the URL for version {current}
## Installation Tarballs can be directly installed using a package manager: -{`\
+{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
pnpm install https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
yarn add https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
npm rm --save xlsx
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
pnpm rm xlsx
pnpm install https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
{`\
+{`\
yarn remove xlsx
yarn add https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
-
+
xlsx-{current}.tgz
) for the desired version. The current
- version is available at https://cdn.sheetjs.com/xlsx-{current}/xlsx-{current}.tgz1) Download the tarball (xlsx-{current}.tgz
) for the desired version. The current
+ version is available at https://cdn.sheetjs.com/xlsx-{current}/xlsx-{current}.tgz
{`\
+{`\
npm i --save file:vendor/xlsx-${current}.tgz`}
-
+
{`\
+{`\
pnpm install file:vendor/xlsx-${current}.tgz`}
-
+
{`\
+{`\
yarn add file:vendor/xlsx-${current}.tgz`}
-
+
https://cdn.sheetjs.com/xlsx-{current}/package/dist/xlsx.full.min.js is the URL for {current}
:::note diff --git a/docz/docs/02-getting-started/01-installation/05-extendscript.md b/docz/docs/02-getting-started/01-installation/05-extendscript.md index 8d397b1..3ba5c49 100644 --- a/docz/docs/02-getting-started/01-installation/05-extendscript.md +++ b/docz/docs/02-getting-started/01-installation/05-extendscript.md @@ -14,7 +14,7 @@ Each standalone release script is available athttps://cdn.sheetjs.com/xlsx-{current}/package/dist/xlsx.extendscript.js is the URL for {current}
After downloading the script, it can be directly referenced with `#include`: diff --git a/docz/docs/02-getting-started/01-installation/06-deno.md b/docz/docs/02-getting-started/01-installation/06-deno.md index 2db7ea9..d9f68a7 100644 --- a/docz/docs/02-getting-started/01-installation/06-deno.md +++ b/docz/docs/02-getting-started/01-installation/06-deno.md @@ -9,6 +9,7 @@ sidebar_custom_props: import current from '/version.js'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; # Deno @@ -16,10 +17,10 @@ Module scripts and type definitions are available at{`\
+{`\
// @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';`}
-
+
The `@deno-types` comment instructs Deno to use the type definitions.
@@ -42,28 +43,28 @@ new versions are released!
If Encoding support is required, `cpexcel.full.mjs` must be manually imported:
-{`\
+{`\
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://cdn.sheetjs.com/xlsx-${current}/package/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);`}
-
+
## Upgrade Notes
Upgrading to the latest version involves changing the import URLs. The import
and the types URLs should be updated at the same time:
-{`\
+{`\
-// @deno-types="https://cdn.sheetjs.com/xlsx-0.18.3/package/types/index.d.ts"
+// @deno-types="https://cdn.sheetjs.com/xlsx-${current}/package/types/index.d.ts"
-
+\n\
-import * as XLSX from 'https://cdn.sheetjs.com/xlsx-0.18.3/package/xlsx.mjs';
+import * as XLSX from 'https://cdn.sheetjs.com/xlsx-${current}/package/xlsx.mjs';
-
+\n\
-import * as cptable from 'https://cdn.sheetjs.com/xlsx-0.18.3/package/dist/cpexcel.full.mjs';
+import * as cptable from 'https://cdn.sheetjs.com/xlsx-${current}/package/dist/cpexcel.full.mjs';
`}
-
+
#### Deno Registry
diff --git a/docz/docs/02-getting-started/01-installation/07-bun.md b/docz/docs/02-getting-started/01-installation/07-bun.md
index 46fba58..0122d6b 100644
--- a/docz/docs/02-getting-started/01-installation/07-bun.md
+++ b/docz/docs/02-getting-started/01-installation/07-bun.md
@@ -10,9 +10,9 @@ import current from '/version.js';
# Bun
-Each standalone release script is available at https://cdn.sheetjs.com/xlsx-{current}/package/xlsx.mjs is the URL for {current}
After downloading the script, it can be directly imported: @@ -41,7 +41,7 @@ new versions are released! If Encoding support is required, `cpexcel.full.mjs` must be manually imported. -https://cdn.sheetjs.com/xlsx-{current}/package/dist/cpexcel.full.mjs is the URL for {current}
```ts diff --git a/docz/docs/02-getting-started/02-example.mdx b/docz/docs/02-getting-started/02-example.mdx index 745469d..0df6cb4 100644 --- a/docz/docs/02-getting-started/02-example.mdx +++ b/docz/docs/02-getting-started/02-example.mdx @@ -192,34 +192,24 @@ worksheet["!cols"] = [ { wch: max_width } ]; +After cleanup, the generated workbook looks like the screenshot below: + +![Final export](pathname:///example/final.png) + ## Export a File `XLSX.writeFile` creates a spreadsheet file and tries to write it to the system. In the browser, it will try to prompt the user to download the file. In NodeJS, it will write to the local directory. -:::note - -`XLSX.writeFileXLSX` only writes XLSX files and is recommended when the export -will always be in the `.xlsx` format. `writeFileXLSX` is more amenable to tree -shaking. This example uses `XLSX.writeFile` since `writeFileXLSX` does not -support other common export formats like `.xls` or `.xlsb` or `.csv`. - -`compression: true` enables ZIP compression for XLSX and other formats. - -::: - ```js XLSX.writeFile(workbook, "Presidents.xlsx", { compression: true }); ``` -![Final export](pathname:///example/final.png) - - ## Live Demo This demo runs in the web browser! Click "Click to Generate File!" and the -browser should generate a XLSX file. +browser should try to create `Presidents.xlsx` ```jsx live function Presidents() { return (