Module: sources/file-system/files/isEmptyFile

Export function to validate if a value is an empty file
Author:
License:
Source:

Example

import { isEmptyFile } from 'itee-validators'

if( isEmptyFile( value ) ) {
    //...
} else {
    //...
}

Requires

Methods


<static> isEmptyFile(filePath, threshold)

Check if given file path is an empty file more or less a threshold in bytes.
Parameters:
Name Type Description
filePath string | Buffer | URL The directory path to check the emptiness
threshold number An amount of byte below which it consider the file as empty ( 0 as default ).
Source:
Returns:
true if file is empty, false otherwise
Type
boolean

<static> isNotEmptyFile(filePath, threshold)

Check if given file path is not an empty file more or less a threshold in bytes.
Parameters:
Name Type Description
filePath string | Buffer | URL The directory path to check the emptiness
threshold number An amount of byte above which it consider the file as not empty ( 0 as default ).
Source:
Returns:
true if file is not empty, false otherwise
Type
boolean