- frameworks: react, react-native, preact, next.js, weex, nuxt.js - deployments: nodejs server, duktape, chakra, electron, nw.js
2.5 KiB
Installation
In the browser, just add a script tag:
<script lang="javascript" src="dist/xlsx.full.min.js"></script>
With npm:
$ npm install xlsx
With bower:
$ bower install js-xlsx
CDNjs automatically pulls the latest version and makes all versions available at http://cdnjs.com/libraries/xlsx
JS Ecosystem Demos
The demos
directory includes sample projects for:
Frameworks and APIs
angular 1.x
angular 2.x / 4.x
meteor
react and react-native
vue 2.x and weex
XMLHttpRequest and fetch
nodejs server
Bundlers and Tooling
Platforms and Integrations
electron application
nw.js application
Adobe ExtendScript
Headless Browsers
canvas-datagrid
Swift JSC and other engines
Optional Modules
Optional features (click to show)
The node version automatically requires modules for additional features. Some of these modules are rather large in size and are only needed in special circumstances, so they do not ship with the core. For browser use, they must be included directly:
<!-- international support from js-codepage -->
<script src="dist/cpexcel.js"></script>
An appropriate version for each dependency is included in the dist/ directory.
The complete single-file version is generated at dist/xlsx.full.min.js
Webpack and browserify builds include optional modules by default. Webpack can
be configured to remove support with resolve.alias
:
/* uncomment the lines below to remove support */
resolve: {
alias: { "./dist/cpexcel.js": "" } // <-- omit international support
}
ECMAScript 5 Compatibility
Since xlsx.js uses ES5 functions like Array#forEach
, older browsers require
Polyfills. This repo and the gh-pages branch include
a shim
To use the shim, add the shim before the script tag that loads xlsx.js:
<script type="text/javascript" src="/path/to/shim.js"></script>