lib/robots/utils
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”getFileSizeInKilobytes()
Section titled “getFileSizeInKilobytes()”function getFileSizeInKilobytes(filename: URL): number
Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:34
Calculates the size of a file in kilobytes.
Parameters
Section titled “Parameters”filename
Section titled “filename”URL
The URL of the file to get the size of.
Returns
Section titled “Returns”number
The size of the file in kilobytes.
measureExecutionTime()
Section titled “measureExecutionTime()”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.
Parameters
Section titled “Parameters”callback
Section titled “callback”() => void
The function whose execution time is to be measured.
Returns
Section titled “Returns”number
The execution time of the callback function in milliseconds.
readJson()
Section titled “readJson()”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.
Type Parameters
Section titled “Type Parameters”T
The type of the parsed JSON object.
Parameters
Section titled “Parameters”The path to the JSON file.
string
| URL
Returns
Section titled “Returns”T
The parsed JSON object.