diff --git a/bin/cli.js b/bin/cli.js index 55af658..76c86dc 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -29,12 +29,18 @@ const options = yargs type: "string", demandOption: false, }) - .argv; + .option("p", { + alias: "print", + describe: "Print the exported json to console", + type: "boolean", + demandOption: false, + }).argv; const inputFile = options.input; const outputFile = options.output; const mapperFile = options.mapper; const sheetName = options.sheet; +const print = options.print; const exported = excel2json({ inputFile: inputFile, @@ -42,3 +48,7 @@ const exported = excel2json({ outputFile: outputFile, sheetName: sheetName, }); + +if (print) { + console.log(exported); +} diff --git a/package.json b/package.json index 58e0fdc..24cde80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "excel2json-xlsx", - "version": "1.0.2", + "version": "1.0.3", "keywords": [ "excel", "json",