🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@tsart/xlsx2json

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsart/xlsx2json

XLSX to JSON parser

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

xlsx2json

XLSX to JSON parser. Extract and combine Excel cells and datasets into JSON array.

Install

npm install @tsart/xlsx2json

Usage

import * as parser from '@tsart/xlsx2json';

let blob: any = fs.readFileSync('test.xls');
let files: parser.OutputFormat[] = parser.parseXLSX(config, blob);

See __test__ folder for other samples.

Config schema

This sample config defines A1, A2 cells and B4:C7 range to extract as JSON object.

domain: excel
fileName: test.xls
fileOptions:
  cellDates: true

# Destination
resultObjects:
  - name: testDS
    columns:
      - ReportDate
      - ReportTitle
    dataset: Table

# Excel cells definitions
cells:
  - name: ReportDate
    sheetName: Sheet1
    cell: A1
  - name: ReportTitle
    sheetName: Sheet1
    cell: A2

# Excel datasets definitions
datasets:
  - name: Table
    sheetName: Sheet1
    range: B4:C7

Credits

Thank you daikiueda for sample XLSX files and a few good insights

Keywords

xlsx

FAQs

Package last updated on 25 May 2020

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