From c19db0238ef486aa75bc5c000961fe8a91288ff4 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Wed, 3 Apr 2024 20:29:30 -0700 Subject: [PATCH] chore: debug --- src/_data/test.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/_data/test.js b/src/_data/test.js index 370863c0..1c659c2e 100644 --- a/src/_data/test.js +++ b/src/_data/test.js @@ -1,20 +1,7 @@ -import fs from 'fs' +import { readFile } from 'fs/promises' export default async function () { - let window; - fs.readFileSync('./src/_data/json/scrobbles-window.json', (error, data) => { - if (error) { - console.log(error); - return; - } - window = JSON.parse(data) + let window = JSON.parse(await readFile('./src/_data/json/scrobbles-window.json', 'utf8')); console.log(window) - }) return window - - // fs.readdir('./src/_data/json/', (err, files) => { - // files.forEach(file => { - // console.log(file); - // }); - // }); }