Home Reference Source

Variable

Static Public Summary
public

Regular expression that matches all "ascendant" paths:

  • '..'
  • '../..'
  • '../../..'
  • etc.
public

Default traversing options.

public

lStat(path: string | Buffer | URL, options: Object): Promise<fs.Stats>: *

Promisified version of fs.lstat(): asynchronous lstat(2).

public

readDir(path: string | Buffer | URL, options: Object): Promise<string[]|Buffer[]|fs.Dirent[]>: *

Promisified version of fs.readdir(): asynchronous readdir(3).

public

stat(path: string | Buffer | URL, options: Object): Promise<fs.Stats>: *

Promisified version of fs.stat(): asynchronous stat(2).

Static Public

public ascendanceRegExp: RegExp source

import {ascendanceRegExp} from 'files-by-directory/src/path.js'

Regular expression that matches all "ascendant" paths:

  • '..'
  • '../..'
  • '../../..'
  • etc.

public defaults: Object source

import defaults from 'files-by-directory/src/options.js'

Default traversing options.

Properties:

NameTypeAttributeDescription
excludeSymlinks boolean

Whether to exclude symbolic links or not.

directoriesFirst boolean

Whether to list directories before files.

showDirectories boolean

Whether to include directories as the first entry of the

followSymlinks boolean

Whether to follow symbolic links or not.

skipEmptyDirectories boolean

Whether to skip empty directories, or include them. result arrays.

public lStat(path: string | Buffer | URL, options: Object): Promise<fs.Stats>: * source

import {lStat} from 'files-by-directory/src/fs.js'

Promisified version of fs.lstat(): asynchronous lstat(2).

Return:

Promise<fs.Stats>

The fs.Stats object.

See:

  • {@link http://man7.org/linux/man-pages/man2/stat.2.html|lstat(2)}
  • {@link https://nodejs.org/api/fs.html#fs_fs_stat_path_options_callback|fs.lstat()}

public readDir(path: string | Buffer | URL, options: Object): Promise<string[]|Buffer[]|fs.Dirent[]>: * source

import {readDir} from 'files-by-directory/src/fs.js'

Promisified version of fs.readdir(): asynchronous readdir(3).

Return:

Promise<string[]|Buffer[]|fs.Dirent[]>

Files.

See:

  • {@link http://man7.org/linux/man-pages/man3/readdir.3.html|readdir(3)}
  • {@link https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback|fs.readdir()}

public stat(path: string | Buffer | URL, options: Object): Promise<fs.Stats>: * source

import {stat} from 'files-by-directory/src/fs.js'

Promisified version of fs.stat(): asynchronous stat(2).

Return:

Promise<fs.Stats>

The fs.Stats object.

See:

  • {@link http://man7.org/linux/man-pages/man2/stat.2.html|stat(2)}
  • {@link https://nodejs.org/api/fs.html#fs_fs_stat_path_options_callback|fs.stat()}