MCPcopy Create free account
hub / github.com/6174/comflowyspace / getFileSize

Function getFileSize

apps/node/src/modules/utils/file-size.ts:6–13  ·  view source on GitHub ↗
(file: string, decimals = 2)

Source from the content-addressed store, hash-verified

4const stat = util.promisify(fs.stat);
5
6export async function getFileSize(file: string, decimals = 2): Promise<string> {
7 try {
8 let statInfo = await stat(file);
9 return formatBytes(statInfo.size, decimals);
10 } catch (err) {
11 return "0 Bytes";
12 }
13}
14
15export function getFileSizeSync(file: string, decimals = 2): string {
16 try {

Callers

nothing calls this directly

Calls 1

formatBytesFunction · 0.85

Tested by

no test coverage detected