aboutsummaryrefslogtreecommitdiff
path: root/stats-doujins.js
blob: 47a25a189761572d3979e231c1584b69b07fe8c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const info = require("./info")
const du = require("./du")

const fmt = (num, size) =>
`Number of doujins:       ${num}
Total size:              ${(size       / 1e9).toFixed(2)}GB
Average size per doujin: ${(size / num / 1e6).toFixed(2)}MB`

info.doujins()
	.then(doujins => Object.keys(doujins))
	.then(doujins => du(doujins)
		.then(total => console.log(fmt(doujins.length, total))))