xls-to-json
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -21,3 +21,3 @@ var fs = require('fs'); | ||
var wb = this.load_xls(config.input) | ||
var ws = this.ws(wb); | ||
var ws = this.ws(wb, config.sheet); | ||
var csv = this.csv(ws) | ||
@@ -31,8 +31,4 @@ this.cvjson(csv, config.output, callback) | ||
CV.prototype.ws = function(wb) { | ||
var target_sheet = ''; | ||
if(target_sheet === '') | ||
target_sheet = wb.SheetNames[0]; | ||
ws = wb.Sheets[target_sheet]; | ||
CV.prototype.ws = function(wb, target_sheet) { | ||
ws = wb.Sheets[target_sheet ? target_sheet : wb.SheetNames[0]]; | ||
return ws; | ||
@@ -39,0 +35,0 @@ } |
{ | ||
"name": "xls-to-json", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Converting xls file to json files using nodejs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,4 +18,5 @@ # node-xls-json | ||
node_xj({ | ||
input: "sample.xls", | ||
output: "output.json" | ||
input: "sample.xls", // input xls | ||
output: "output.json" // output json | ||
sheet: "sheetname", // specific sheetname | ||
}, function(err, result) { | ||
@@ -22,0 +23,0 @@ if(err) { |
Sorry, the diff of this file is not supported yet
124716
36
114