Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@borgar/xlsx-convert

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@borgar/xlsx-convert

Utility to convert Excel XLSX files to JSON

latest
Source
npmnpm
Version
3.5.1
Version published
Weekly downloads
345
2.07%
Maintainers
1
Weekly downloads
 
Created
Source

XLSX-convert

This is a Node.js utility to convert Excel XLSX files to JSON format. It supports only XLSX files and outputs JSF (JSON spreadsheet format), a variant of CSF (see below).

This utility was developed as tooling for GRID – The new face of spreadsheets, to which it owes a debt of gratitude.

Installing

The library is also provided as an NPM package:

$ npm install @borgar/xlsx-convert

Usage

// import the converter
import xlsxConvert from '@borgar/xlsx-convert';

// read the file
const jsf = await xlsxConvert('path/to/workbook.xlsx', options);

// emit results
console.log(jsf);

This will emit a structure like this:

{
  "filename": "workbook.xlsx",
  "sheets": [
    {
      "cells": {
        "A1": { "v": 12 },
        "B1": { "v": 123.1 },
        "A2": { "v": "Total" },
        "B2": { "v": 135.1, "f": "SUM(A1:B1)", },
      },
      "merges": [],
      "colWidths": [],
      "rowHeights": [],
      "hidden": 0,
      "name": "Sheet1"
    }
  ],
  "names": [],
  "styles": [
    { "font-size": 12 }
  ]
}

# Output:

The JSON spreadsheet format is similar to, but not 100% compatible with the CSF structure emitted by the xlsx package. Supported cell properties are:

Cell.Note
vValue of the cell in its correct type.
fAn integer index into a list of formula expressions in R1C1-syntax, or an expression string in A1-syntax.
FThe A1-style range of enclosing array if the formula is an array formula.
cA list of comments attached to the cell.
s (optional)Index of style information associated with the cell.
t (optional)A type for the value in the cell (this library only emits an "e" when the value is an error).
l (optional)A URL attached to the cell.

Only cells that have "relevant data" are emitted, which in praxis means cells that have such things as values, formula, and visible styles attached to them.

Documentation

Documentation can be found under docs/:

  • The API is documented in docs/API.md.

Keywords

excel

FAQs

Package last updated on 24 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts