DataAdapter.stat method
DataAdapter › stat
Official
Retrieve metadata about the given file/folder.Signature:
stat(normalizedPath: string): Promise<Stat | null>Parameters:
| Parameter | Type | Description |
|---|---|---|
| normalizedPath | string | path to file/folder, use {@link normalizePath} to normalize beforehand. |
Returns: Promise<Stat | null> — The metadata, or null if nothing exists at the path.
Since: 0.12.2
Example:
const stat = await adapter.stat(path);if (stat?.type === 'file') { console.log(stat.size, stat.mtime);}