diff --git a/src/npmstat.js b/src/npmstat.js index e2d77b5..c8f36d3 100644 --- a/src/npmstat.js +++ b/src/npmstat.js @@ -257,6 +257,17 @@ class WriteNpmStat { const stats = this.getLastWeekNpmStat(); stats.then((stats) => { const day = StatDate.formatStart(new Date()); + if (Object.keys(stats).length === 0) { + const statKey = day.concat("_", "-"); + const statValue = []; + statValue.push(day); + if (this.#writePackageName) { + statValue.push(this.#packageName); + } + statValue.push("-"); + statValue.push(0); + stats[statKey] = statValue; + } const grouped = this.#groupStats( lastWeek, stats,