docs.sheetjs.com/docz/docs/02-installation/02-frameworks.md
2022-06-05 18:43:44 -04:00

1.5 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 Support

If XLS support is required, cpexcel.full.mjs 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);