Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_text/tests/detect_corpus/js/shebang.txt

585 bytes, 1 run

created by r1870400018:12006, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1#!/usr/bin/env node
2
3const args = process.argv.slice(2);
4const verbose = args.includes('--verbose');
5
6function formatBytes(bytes) {
7 if (bytes === 0) return '0 B';
8 const units = ['B', 'KB', 'MB', 'GB', 'TB'];
9 const i = Math.floor(Math.log(bytes) / Math.log(1024));
10 return `${(bytes / Math.pow(1024, i)).toFixed(1)} ${units[i]}`;
11}
12
13const usage = process.memoryUsage();
14console.log(`heap: ${formatBytes(usage.heapUsed)} / ${formatBytes(usage.heapTotal)}`);
15console.log(`rss: ${formatBytes(usage.rss)}`);
16
17if (verbose) {
18 console.log(JSON.stringify(usage, null, 2));
19}