UNPKG

@luvsharma1931/memory-profiler

Version:

Intelligent memory profiler for Node.js applications to provide memory leak and heap memory usage information

25 lines (21 loc) 634 B
var FS = require("fs"); var logPath = "C:/memory-profiler-logs" var createFolderStructure = function() { if (FS.existsSync(logPath)) { if(FS.existsSync(`${logPath}/memoryLeak.txt`)) { FS.unlinkSync(`${logPath}/memoryLeak.txt`) } if(FS.existsSync(`${logPath}/memoryStats.txt`)) { FS.unlinkSync(`${logPath}/memoryStats.txt`) } if(FS.existsSync(`${logPath}/logs.txt`)) { FS.unlinkSync(`${logPath}/logs.txt`) } } else { FS.mkdirSync(logPath); } } module.exports = { logPath, createFolderStructure }