New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-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

node-xlsx2json

Excel XLSX document to JSON converter as a Node.js library and a command line utility

  • 0.9.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
increased by383.33%
Maintainers
1
Weekly downloads
 
Created
Source

Introduction

Excel XLSX document to JSON converter as a Node.js library and a command line utility.

Getting Started

Install the package:

npm install -g node-xlsx2json

Convert the document:

xlsx2json --verbose path/to/sample.xlsx sample.json

Command Line

Usage:
  xslx2json [options] <input.xlsx> <output.json>

Options:
  --force         Force overwrite file
  --help          Print this message
  --verbose       Enable detailed logging
  --version       Print version number

Examples:
  xlsx2json --version
  xlsx2json --verbose file.xlsx
  xlsx2json --force file.xlsx file.json

Using as library

var xlsx2json = require('node-xlsx2json');
xlsx2json('path/to/sample.xlsx', function(error, result) {
  if (error) return console.error(error);
  console.log(result);
});

Example of output

{
  "worksheets": [
    {
      "sheetId": 1,
      "name": "Blank",
      "data": []
    },
    {
      "sheetId": 2,
      "name": "Calculate",
      "data": [
        {
          "cell": "A1",
          "value": "1"
        },
        {
          "cell": "A2",
          "value": "2"
        },
        {
          "cell": "A3",
          "formula": "=SUM(A1:A2)",
          "value": "3"
        },
        {
          "cell": "C3",
          "formula": "=2 * (PI() / 4)",
          "value": "1.5707963267948966"
        }
      ]
    },
    {
      "sheetId": 3,
      "name": "Variables",
      "data": [
        {
          "cell": "A1",
          "type": "string",
          "value": "xlsx2json"
        },
        {
          "cell": "A2",
          "value": "1234"
        },
        {
          "cell": "A3",
          "value": "1",
          "display": "1",
          "format": "0"
        },
        {
          "cell": "A4",
          "value": "10"
        },
        {
          "cell": "A5",
          "value": "0.99",
          "display": "99%",
          "format": "0%"
        },
        {
          "cell": "A6",
          "value": "0.5625"
        }
      ]
    }
  ]
}

FAQs

Package last updated on 07 Aug 2017

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc