Skip to content

mrunion/node-excel-to-json

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel2JSON

Turn any xls or xlsx file into a clean JSON file or Javascript Object. This module is npm module 'XLXS' Pure-JS cleanroom implementation from official specifications and related documents.

Supported read formats:

  • Excel 2007+ XML Formats (XLSX/XLSM)
  • Excel 2007+ Binary Format (XLSB)
  • Excel 2003-2004 XML Format (XML "SpreadsheetML")
  • Excel 97-2004 (XLS BIFF8)
  • Excel 5.0/95 (XLS BIFF5)
  • OpenDocument Spreadsheet (ODS)

Install

$ npm install node-excel-to-json

Usage

excel2Json(fileName, [options], callback)

Where

  • fileName relative path of Excel file.
  • options is a optional args { convert_all_sheet: true, return_type: 'File', sheetName: '' }
    • convert_all_sheet If this value is false, Then one sheet will processed which name would be provided
    • return_type Two type of return type 'File' or 'Object'
    • sheetName Only if convert_all_sheet=false
  • callback is the callback to run - callback(error, output)

Example

var excel2Json = require('excel2json');

excel2Json('sample.xls', function(err, output) {

});

excel2Json('../test/sample.xls', {
    'convert_all_sheet': false,
    'return_type': 'File',
    'sheetName': 'survey'
}, function(err, output) {

});

About

NPM module to convert a Excel to JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%