The filestore-disk/utils module returns a map of utility functions used throughout the filestore.
- Source:
Requires
Methods
-
<static> getStats(baseDir, filePath) → {external:q}
-
This function gets the file stats from the path specified, normalizes it using the normalizeStats function and returns it.
Parameters:
Name Type Description baseDirString the root directory for the filestore
filePathString the path of the file or directory whose stat is to be fetched
- Source:
Returns:
A promise that gets resolved by the Stats object once the stats are fetched and normalized. In case of an error, the promise is rejected with the error.
- Type
- external:q
-
<static> normalizeStats(stats, filePath) → {module:filestore-disk/utils~Stats}
-
This function takes node file stats and normalizes it for use by the filestore
Parameters:
Name Type Description statsfs.Stats the node file stats object
filePathString the path of the file whose stat is to be normalized
- Source:
Returns:
the stats object
Type Definitions
-
Stats
-
The Stats object is a normalized file metadata that is used by filestore
Type:
- object
- Source:
Properties:
Name Type Description nameString The base name (including extension) of the file
extensionstring The file extension
pathstring filestore-relative path of the file
typeString the type of the file, can be F (for file), D (for directories) or L (for links)
sizeNumber the size of the file
createdDate when was the file created
modifiedDate when was the file last modified