New "browse" UI

Also, separated out browse, ?meta, and ?module request handlers.

Fixes #82
This commit is contained in:
Michael Jackson
2019-07-24 17:55:13 -07:00
parent ea35b3c4b0
commit 34baab07ab
57 changed files with 2431 additions and 686 deletions

View File

@ -0,0 +1,18 @@
import formatBytes from 'pretty-bytes';
export { formatBytes };
export function formatNumber(n) {
const digits = String(n).split('');
const groups = [];
while (digits.length) {
groups.unshift(digits.splice(-3).join(''));
}
return groups.join(',');
}
export function formatPercent(n, decimals = 1) {
return (n * 100).toPrecision(decimals + 2);
}