Skip to main content

AMD (define)

Each standalone release script is available at

xlsx.full.min.js supports AMD with name xlsx out of the box. is the URL for 0.20.1

When referencing by file name, AMD loaders typically omit the file extension.

The actual file name is xlsx.full.min.js, but the examples identify the script using the name xlsx.full.min

Watch the repo or subscribe to the RSS feed to be notified when new versions are released!


After downloading the script and uploading to the file cabinet, a module alias must be added to the @NAmdConfig configuration file:

"paths": {
"xlsx": "/path/to/xlsx.full.min"

Once added, SuiteScripts can reference the package using the name xlsx:

* @NApiVersion 2.x
* ... more options ...
* @NAmdConfig ./JsLibraryConfig.json
define(['N/file', 'xlsx'], function(file, XLSX) {
// ... use XLSX here ...

More details are included in the NetSuite demo


After downloading the script, it can be uploaded to the UI5 project and loaded in the sap.ui.define call:

/* ... other libraries ... */
], function(/* ... variables for the other libraries ... */, XLSX) {
// use XLSX here

Copy and pasting code does not work for SheetJS scripts as they contain Unicode characters that may be mangled. The standalone script should be downloaded and manually uploaded to the project.


The standalone script must be aliased to the path xlsx.

The requirejs.config function can define aliases through the paths key:

paths: {
xlsx: [ './xlsx.full.min' ]

After configuring the alias, app code can freely require xlsx:

require(['xlsx'], function(XLSX) {
// ... use XLSX here

See the RequireJS demo for details

Dojo Toolkit

Dojo has changed module loading strategies over the years. These examples were tested with Dojo 1.17.3. They are not guaranteed to work with other versions.

Live demos are included in "Dojo Toolkit"

The standalone scripts add window.XLSX, so it is recommended to use _XLSX in the function arguments and access the library with XLSX in the callback:

require(["xlsx"], function(
_XLSX // !! NOTE: this is not XLSX! A different variable name must be used
) {
console.log(XLSX.version); // use XLSX in the callback

Synchronous Loading

When async is set to false or 0, the scripts can be directly referenced in require calls.

<script src="dojo.js" data-dojo-config="isDebug:1, async:0"></script>
], function(
_XLSX // !! NOTE: this is not XLSX! A different variable name must be used
) {
// ... use XLSX here

Asynchronous Loading

When async is enabled, Dojo will only understand the name xlsx. The config object can map package names to scripts:

// This setting must appear *before* loading dojo.js
dojoConfig = {
packages: [
name: "xlsx",
// if self-hosting the script, location should be a folder relative to baseUrl setting
location: "",
// name of the script (without the .js extension)
main: "xlsx.full.min"
<script src="dojo.js" data-dojo-config="isDebug:1, async:1"></script>
require(["xlsx"], function(_XLSX) {
// ... use XLSX here