Skip to content

Commit

Permalink
feat: out generated json size in MB
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Aug 23, 2020
1 parent 6e692fa commit dbff72d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ async function start() {
if (program.json) {
await saveAsJson(csvPath, jsonPath, program.lang, program.preset);
if (!program.removeJson) console.log('Saved to ' + jsonPath);

const stats = fs.statSync(jsonPath);
const fileSizeInBytes = stats.size;
const fileSizeInMegabytes = fileSizeInBytes / 1000000.0
const fileSizeRounded = Math.round(fileSizeInMegabytes * 100) / 100;
console.log(`Size: ${fileSizeRounded} MB`);

if (program.upload) webPath = await uploadJson(jsonPath, program);
// if (program.gdrive) webPath = await publishGoogleDrive(jsonPath);

Expand Down

0 comments on commit dbff72d

Please sign in to comment.