xls-to-json
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -5,4 +5,2 @@ const fs = require("fs"); | ||
module.exports = XLS_json; | ||
function XLS_json(config, callback) { | ||
@@ -15,3 +13,3 @@ if (!config.input) { | ||
} | ||
const cv = new CV(config, callback); | ||
new CV(config, callback); | ||
} | ||
@@ -23,3 +21,3 @@ | ||
const csv = this.csv(ws); | ||
this.cvsjson(csv, config.output, callback, config.rowsToSkip || 0); | ||
this.CSVToJSON(csv, config.output, callback, config.rowsToSkip || 0); | ||
} | ||
@@ -40,3 +38,3 @@ | ||
CV.prototype.cvsjson = function (csv, output, callback, rowsToSkip) { | ||
CV.prototype.CSVToJSON = function (csv, output, callback, rowsToSkip) { | ||
let records = []; | ||
@@ -67,3 +65,3 @@ let header = []; | ||
// the 'end' event may fire before the file has been written | ||
if (output !== null) { | ||
if (output) { | ||
var stream = fs.createWriteStream(output, { flags: "w" }); | ||
@@ -84,1 +82,3 @@ stream.write(JSON.stringify(records)); | ||
// TODO: filter columns with no header: "" | ||
module.exports = XLS_json; |
{ | ||
"name": "xls-to-json", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Converting xls file to json files using nodejs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3811