The Wayback Machine - https://web.archive.org/web/20230122001658/https://cdn.sheetjs.com/

SheetJS Modules and Scripts

This site includes current and historical releases of SheetJS Community Edition. The project is licensed under the Apache 2.0 License, which should be perused before usage. It is a permissive license with certain attribution requirements. docs.sheetjs.com includes library usage documentation.
How to Use "NodeJS Package" for NodeJS and Angular/React/Vue apps (click to show) "NodeJS Package" links can be directly installed with a package manager: ## This installs a module named "xlsx" using the NodeJS Package on the CDN $ pnpm install --save https://cdn.sheetjs.com/xlsx-/xlsx-.tgz $ npm install --save https://cdn.sheetjs.com/xlsx-/xlsx-.tgz $ yarn add https://cdn.sheetjs.com/xlsx-/xlsx-.tgz They can also be downloaded and added to your project: 1) Download "NodeJS Package" (xlsx-.tgz) 2) Create a `sheetjs` subdirectory at the root of your project 3) Move NodeJS Package to the sheetjs folder 4) Use your package manager to install the file directly: $ pnpm install --save file:sheetjs/xlsx-.tgz $ npm install --save file:sheetjs/xlsx-.tgz $ yarn add file:sheetjs/xlsx-.tgz Once installed, you can use `require` or `import` the module using the name "xlsx": var XLSX = require("xlsx"); // in NodeJS import { read, utils, writeFileXLSX } from 'xlsx'; // in browser apps
How to Use "Standalone" / "Mini Build" / "Shim" in standard sites (click to show) The .js links can be directly referenced with a script tag: <!-- This loads the shim from the CDN --> <script src="https://cdn.sheetjs.com/xlsx-/package/dist/shim.min.js"></script> <!-- This loads the standalone build from the CDN --> <script src="https://cdn.sheetjs.com/xlsx-/package/dist/xlsx.full.min.js"></script> The scripts can be downloaded and added to your project: 1) Download the required scripts. Decision tree: - Are you trying to read XLS and older spreadsheets? If yes, download the "Standalone" build If no, download the "Mini" build - Do you need to support older browsers like IE11? If yes, also download the Shim 2) Move the scripts to the folder with your other scripts 3) If you need the shim, load it before the other scripts: <script src="shim.min.js"></script> 4) Load the other script: If you downloaded the "Standalone" build: <script src="xlsx.full.min.js"></script> If you downloaded the "Mini" build: <script src="xlsx.mini.min.js"></script>
How to Use "ESM" with `script type="module"` (click to show) The .mjs links can be imported in a module context: <script type="module"> /* This imports the module from the CDN */ import { read, utils, writeFile } from "https://cdn.sheetjs.com/xlsx-/package/xlsx.mjs"; </script> The script can be downloaded and added to your project: 1) Download "ESM/Deno" script ("Save Link As...") 2) Move `xlsx.mjs` to your project, in a folder with other browser scripts 3) Use relative file references in import and type statements: <script type="module"> import { read, utils, writeFile } from "./xlsx.mjs"; // ... use the imported functions here </script>
How to Use "Types" and "ESM" in Deno (click to show) The .mjs links are ES Modules that "just work" in Deno. The .d.ts links are TypeScript definitions and can be referenced with @deno-types: // @deno-types="https://cdn.sheetjs.com/xlsx-/package/types/index.d.ts" import * as XLSX from 'https://cdn.sheetjs.com/xlsx-/package/xlsx.mjs'; Named imports also work: // @deno-types="https://cdn.sheetjs.com/xlsx-/package/types/index.d.ts" import { read, writeFile } from 'https://cdn.sheetjs.com/xlsx-/package/xlsx.mjs'; Both scripts can be downloaded and added to your project: 1) Download "Types" and "ESM/Deno" scripts ("Save Link As...") 2) Create a `sheetjs` subdirectory at the root of your project 3) Move `index.d.ts` and `xlsx.mjs` to the sheetjs folder 4) Use relative file references in import and type statements: // @deno-types="./sheetjs/index.d.ts"; import { read, writeFile } from './sheetjs/xlsx.mjs';
Links can (and should) be saved and added to your project. "Vendoring" scripts and modules reduces the software supply chain attack surface. It also enables offline deployments when Internet access is not available or permitted. - Watch the repo to be notified when new versions are released! Current Version: ??
Version
NodeJS Package
Standalone
Mini Build
Shim
ESM/Deno
Types