fs.size
fs.size
Function
Read file or directory metadata size.
Syntax
fs(path).size()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Int | Returns the number of bytes of the underlying metadata.len(). |
Example
file = fs('docs-size.txt') file.write('BT') result = file.size() // Output: 2 print result
Notes
- The directory size is determined by operating system metadata and is not equal to the total size of files in the directory.