Socket
Socket
Sign inDemoInstall

@tsart/xlsx2json

Package Overview
Dependencies
13
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @tsart/xlsx2json

XLSX to JSON parser


Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Install size
16.0 MB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 25 May 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc