:book: When you pass a plain object, an instance of the Settings class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the Settings class.
:book: Always use fs.readdir without the withFileTypes option. ??TODO??
followSymbolicLinks
Type: boolean
Default: false
Follow symbolic links or not. Call fs.stat on symbolic link if true.
throwErrorOnBrokenSymbolicLink
Type: boolean
Default: true
Throw an error when symbolic link is broken if true or safely use lstat call if false.
pathSegmentSeparator
Type: string
Default: path.sep
By default, this package uses the correct path separator for your OS (\ on Windows, / on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
This package has two modes that are used depending on the environment and parameters of use.
old
Node.js below 10.10 or when the stats option is enabled
When working in the old mode, the directory is read first (fs.readdir), then the type of entries is determined (fs.lstat and/or fs.stat for symbolic links).
modern
Node.js 10.10+ and the stats option is disabled
In the modern mode, reading the directory (fs.readdir with the withFileTypes option) is combined with obtaining information about its entries. An additional call for symbolic links (fs.stat) is still present.
This mode makes fewer calls to the file system. It's faster.