Get started with xls CDN

Apache License, Version 2.0 licensed

XLS library reads/writes Excel data in browsers, no Excel or plugins needed.

Tags:
  • excel
  • spreadsheet
  • xls
  • parser

Stable version

Copied!

How to start using xls CDN


// Include the XLS library from the CDN
const XLS = require('xls/XLSX');

// Read the XLS file as a binary data
fetch('path/to/your/file.xlsx')
  .then(response => response.arrayBuffer())
  .then(data => {
    // Create a workbook from the binary data
    const workbook = XLS.read(new Uint8Array(data), { cellStyles: true });

    // Select the worksheet name
    const worksheetName = workbook.SheetNames[0];

    // Access the data in the worksheet
    const worksheet = workbook.Sheets[worksheetName];

    // Log the data to the console
    console.log(XLS.utils.sheet_to_json(worksheet));
  })
  .catch(error => console.error(error));

All versions