docs.sheetjs.com/docz/docs/02-installation/02-frameworks.md

1.6 KiB

sidebar_position sidebar_custom_props
2
summary
Angular, React, VueJS, Webpack, etc.

import current from '/version.js';

Frameworks and Bundlers

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

Each standalone release package is available at https://cdn.sheetjs.com/. The NodeJS package is designed to be used with frameworks and bundlers. It is a proper ECMAScript Module release which can be optimized with developer tools.

{`\
$ npm install --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
{`\
$ pnpm install --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
{`\
$ yarn add --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}

Once installed, the library can be imported under the name xlsx:

import { read, writeFileXLSX } from "xlsx";
XLS Codepage support (click to show)

If XLS support is required, cpexcel.full.js must be manually imported:

/* load the codepage support library for extended support with older formats  */
import { set_cptable } from "xlsx";
import * as cptable from 'xlsx/dist/cpexcel.full.mjs';
set_cptable(cptable);