Skip to content

datasource.fileSize ​

Returns the size of a file.

js
datasource.fileSize(fileName)

Parameters ​

ParameterTypeDescription
fileNamestringThe path of the file.

Returns ​

number

The file's size in bytes, or 0 when the file doesn't exist or the path is invalid.

Examples ​

js
const bytes = datasource.fileSize("my_file.txt");