fs.ts

Declarations
#

4 declarations

view source

fs_empty_dir
#

fs.ts view source

(dir: string, should_remove?: ((name: string) => boolean) | undefined, options?: RmOptions | undefined): Promise<void>

Empties a directory, recursively by default. If should_remove is provided, only entries where it returns true are removed.

dir

type string

should_remove?

type ((name: string) => boolean) | undefined
optional

options?

type RmOptions | undefined
optional

returns

Promise<void>

fs_exists
#

fs.ts view source

(path: string): Promise<boolean>

Checks if a file or directory exists.

path

type string

returns

Promise<boolean>

fs_search
#

FsSearchOptions
#

fs.ts view source

FsSearchOptions

filter

One or more filter functions, any of which can short-circuit the search by returning false.

type PathFilter | Array<PathFilter>

file_filter

One or more file filter functions. Every filter must pass for a file to be included.

type FileFilter | Array<FileFilter>

sort

Pass null or false to speed things up at the cost of volatile ordering.

type boolean | null | ((a: ResolvedPath, b: ResolvedPath) => number)

include_directories

Set to true to include directories. Defaults to false.

type boolean

cwd

Sets the cwd for dir unless it's an absolute path or null.

type string | null

Depends on
#

Imported by
#