diff --git a/src/lib/history.mjs b/src/lib/history.mjs index 204d823..2fc9a01 100644 --- a/src/lib/history.mjs +++ b/src/lib/history.mjs @@ -5,8 +5,8 @@ const MAX_ITEMS = 1000; // max entries in history const TRUNCATE_AMOUNT = 200; // count of entries to remove when max is hit export default class History { - constructor() { - this.filePath = path.resolve('data', 'history.json'); + constructor(filename = 'history.json') { + this.filePath = path.resolve('data', filename); try { const data = fs.readFileSync(this.filePath); this.db = data.length === 0 ? [] : JSON.parse(data);