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": [],