Skip to content

lib/robots/utils

function getFileSizeInKilobytes(filename: URL): number

Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:34

Calculates the size of a file in kilobytes.

URL

The URL of the file to get the size of.

number

The size of the file in kilobytes.


function measureExecutionTime(callback: () => void): number

Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:20

Measures the execution time of a given callback function.

() => void

The function whose execution time is to be measured.

number

The execution time of the callback function in milliseconds.


function readJson<T>(path: string | URL): T

Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:10

Reads a JSON file from the specified path and parses its content.

T

The type of the parsed JSON object.

The path to the JSON file.

string | URL

T

The parsed JSON object.