From bc4df4dd5e24a77975dbdcda75f91eaa08a6be8e Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 13 Jan 2024 17:17:31 +0100 Subject: [PATCH] Edit path for the metrics.json --- basics.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/basics.js b/basics.js index 2dc6a5e..8d0e92a 100644 --- a/basics.js +++ b/basics.js @@ -1,7 +1,7 @@ const fs = require("fs") const path = require("path") -var metricsPathFile = metricsPathFile +var metricsPathFile = "./metrics.json" module.exports.getDate = function (formated) { @@ -52,7 +52,7 @@ module.exports.setMetricsFile = (path) => { module.exports.getMetricsFile = () => { - if(!fs.existsSync()) { + if(!fs.existsSync(metricsPathFile)) { fs.writeFileSync(metricsPathFile, JSON.stringify([], null, 2)) } else { return JSON.parse(fs.readFileSync(metricsPathFile)) diff --git a/package.json b/package.json index 4f47177..dcff571 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webmetrik", - "version": "0.1.3", + "version": "0.1.4", "description": "NodeJS - npm package - Make metrics and make it available by making a httpServer", "main": "main.js", "keywords": [],