From c091257470d1c4f4ae456a920ab572168b2516dd Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 23 Jan 2022 16:34:25 +0300 Subject: [PATCH] Move to /scripts --- update.js => scripts/update.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename update.js => scripts/update.js (94%) diff --git a/update.js b/scripts/update.js similarity index 94% rename from update.js rename to scripts/update.js index e307732..78a6ef6 100644 --- a/update.js +++ b/scripts/update.js @@ -1,7 +1,7 @@ const csv = require('csvtojson') -const fs = require('fs') const path = require('path') const glob = require('glob') +const fs = require('fs') const DATABASE_DIR = './database' const OUTPUT_DIR = './.gh-pages' @@ -18,6 +18,6 @@ glob(`${DATABASE_DIR}/*.csv`, async function (err, files) { const outputFile = `${OUTPUT_DIR}/${inputFilename}.json` const json = await csv().fromFile(inputFile) - fs.writeFileSync(path.resolve(outputFile), JSON.stringify(json)) + fs.writeFileSync(path.resolve(outputFile), JSON.stringify(json, null, 2)) } })