Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "fs/index"

Index

Type aliases

FileSystemPath

FileSystemPath: string | Buffer

A value, that can be used as file system path.

Functions

checkExistingFSItemByStats

  • checkExistingFSItemByStats(path: FileSystemPath, useLSTAT: boolean, flagProvider: (stats: FSStats) => boolean): Promise<boolean>
  • Parameters

    • path: FileSystemPath
    • useLSTAT: boolean
    • flagProvider: (stats: FSStats) => boolean
        • (stats: FSStats): boolean
        • Parameters

          • stats: FSStats

          Returns boolean

    Returns Promise<boolean>

checkExistingFSItemByStatsSync

  • checkExistingFSItemByStatsSync(path: FileSystemPath, useLSTAT: boolean, flagProvider: (stats: FSStats) => boolean): boolean
  • Parameters

    • path: FileSystemPath
    • useLSTAT: boolean
    • flagProvider: (stats: FSStats) => boolean
        • (stats: FSStats): boolean
        • Parameters

          • stats: FSStats

          Returns boolean

    Returns boolean

exists

  • exists(path: fs.PathLike): Promise<boolean>
  • Promise version of 'fs.exists()'.

    Parameters

    • path: fs.PathLike

      The path.

    Returns Promise<boolean>

    The promise that indicates if path exists or not.

glob

  • glob(patterns: string | string[], opts?: fastGlob.Options): Promise<string[]>
  • Scans for files.

    Parameters

    • patterns: string | string[]

      One or more glob patterns.

    • Optional opts: fastGlob.Options

    Returns Promise<string[]>

    The promise with the found items.

globSync

  • globSync(patterns: string | string[], opts?: fastGlob.Options): string[]
  • Scans for files (synchronious).

    Parameters

    • patterns: string | string[]

      One or more glob patterns.

    • Optional opts: fastGlob.Options

    Returns string[]

    The found items.

isBlockDevice

  • isBlockDevice(path: FileSystemPath, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path represents an existing block device.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a block device or not.

isBlockDeviceSync

  • isBlockDeviceSync(path: FileSystemPath, useLSTAT?: boolean): boolean
  • Checks if a path represents an existing block device (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a block device or not.

isCharDevice

  • isCharDevice(path: FileSystemPath, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path represents an existing block device.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a block device or not.

isCharDeviceSync

  • Checks if a path represents an existing character device (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a character device or not.

isDir

  • Checks if a path represents an existing directory.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a directory or not.

isDirSync

  • Checks if a path represents an existing directory (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a directory or not.

isFIFO

  • Checks if a path represents an existing FIFO.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a FIFO or not.

isFIFOSync

  • Checks if a path represents an existing FIFO (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a FIFO or not.

isFile

  • Checks if a path represents an existing file.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a file or not.

isFileSync

  • Checks if a path represents an existing file (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a file or not.

isSocket

  • isSocket(path: FileSystemPath, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path represents an existing socket.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a socket or not.

isSocketSync

  • Checks if a path represents an existing socket (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a socket or not.

isSymLink

  • Checks if a path represents an existing symbolic link.

    Parameters

    Returns Promise<boolean>

    The promise with the boolean that represents if path is a symbolic link or not.

isSymLinkSync

  • Checks if a path represents an existing symbolic link (synchronous).

    Parameters

    Returns boolean

    The boolean that represents if path is a symbolic link or not.

mergeGlobOptions

  • mergeGlobOptions(opts: fastGlob.Options): fastGlob.Options

normalizeGlobPatterns

  • normalizeGlobPatterns(patterns: string | string[]): string[]

tempFile

  • tempFile<TResult>(action: (tmpFile: string) => Promise<TResult> | TResult, opts?: TempFileOptions): Promise<TResult>
  • Executes an action for a temp file.

    Type parameters

    • TResult

    Parameters

    • action: (tmpFile: string) => Promise<TResult> | TResult

      The action to invoke.

        • (tmpFile: string): Promise<TResult> | TResult
        • Parameters

          • tmpFile: string

          Returns Promise<TResult> | TResult

    • Optional opts: TempFileOptions

    Returns Promise<TResult>

    The promise with the result of the action.

tempFileSync

  • tempFileSync<TResult>(action: (tmpFile: string) => TResult, opts?: TempFileOptions): TResult
  • Executes an action for a temp file (sync).

    Type parameters

    • TResult

    Parameters

    • action: (tmpFile: string) => TResult

      The action to invoke.

        • (tmpFile: string): TResult
        • Parameters

          • tmpFile: string

          Returns TResult

    • Optional opts: TempFileOptions

    Returns TResult

    The result of the action.

toSimpleTempOptions

Generated using TypeDoc