Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "fs/index"

Index

Type aliases

FastGlobEntryItem

FastGlobEntryItem: string | IFastGlobEntry

FastGlobOptions

FastGlobOptions: FastGlob.Options

TempFilePath

TempFilePath: string | false

Variables

Const MergeDeep

MergeDeep: any = require('merge-deep')

Functions

createDirectoryIfNeeded

  • createDirectoryIfNeeded(dir: string): Promise<boolean>
  • Creates a directory (if needed).

    Parameters

    • dir: string

      The path of the directory to create.

    Returns Promise<boolean>

    The promise that indicates if directory has been created or not.

exists

  • exists(path: string | Buffer): Promise<boolean>
  • Promise version of 'FS.exists()' function.

    Parameters

    • path: string | Buffer

      The path.

    Returns Promise<boolean>

    The promise that indicates if path exists or not.

fastGlob

  • fastGlob(patterns: string | string[], opts?: FastGlob.Options): Promise<FastGlobEntryItem[]>
  • Fast version of 'node-glob'.

    Parameters

    • patterns: string | string[]

      One or more patterns to search for.

    • Optional opts: FastGlob.Options

    Returns Promise<FastGlobEntryItem[]>

    Promise with the found files / directories.

fastGlobSync

  • fastGlobSync(patterns: string | string[], opts?: FastGlob.Options): FastGlobEntryItem[]
  • Fast version of 'node-glob' (sync).

    Parameters

    • patterns: string | string[]

      One or more patterns to search for.

    • Optional opts: FastGlob.Options

    Returns FastGlobEntryItem[]

    The found files / directories.

glob

  • glob(patterns: string | string[], opts?: Glob.IOptions): Promise<string[]>
  • Promise version of 'Glob()' function.

    Parameters

    • patterns: string | string[]

      One or more patterns.

    • Optional opts: Glob.IOptions

    Returns Promise<string[]>

    The promise with the matches.

globSync

  • globSync(patterns: string | string[], opts?: Glob.IOptions): string[]
  • Multi pattern version of 'Glob.sync()' function.

    Parameters

    • patterns: string | string[]

      One or more patterns.

    • Optional opts: Glob.IOptions

    Returns string[]

    The matches.

invokeForStats

  • invokeForStats<TResult>(path: string, useLSTAT: any, func: function, defaultValue?: TResult): Promise<TResult>
  • Type parameters

    • TResult

    Parameters

    • path: string
    • useLSTAT: any
    • func: function
        • (stats: Stats): TResult
        • Parameters

          • stats: Stats

          Returns TResult

    • Optional defaultValue: TResult

    Returns Promise<TResult>

invokeForStatsSync

  • invokeForStatsSync<TResult>(path: string, useLSTAT: any, func: function, defaultValue?: TResult): TResult
  • Type parameters

    • TResult

    Parameters

    • path: string
    • useLSTAT: any
    • func: function
        • (stats: Stats): TResult
        • Parameters

          • stats: Stats

          Returns TResult

    • Optional defaultValue: TResult

    Returns TResult

isBlockDevice

  • isBlockDevice(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a block device.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isBlockDeviceSync

  • isBlockDeviceSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a block device.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

isCharacterDevice

  • isCharacterDevice(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a character device.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isCharacterDeviceSync

  • isCharacterDeviceSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a character device.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

isDirectory

  • isDirectory(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a directory.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isDirectorySync

  • isDirectorySync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a directory.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

isFIFO

  • isFIFO(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is FIFO.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isFIFOSync

  • isFIFOSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is FIFO.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

isFile

  • isFile(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a file.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isFileSync

  • isFileSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a file.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

isSocket

  • isSocket(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a socket.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isSocketSync

  • isSocketSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a socket.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

isSymbolicLink

  • isSymbolicLink(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a symbolic link.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isSymbolicLinkSync

  • isSymbolicLinkSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a symbolic link.

    Parameters

    • path: string

      The path to check.

    • Default value useLSTAT: boolean = true

    Returns boolean

    A value that indicates if condition matches or not.

normalizeGlobOptions

  • normalizeGlobOptions(opts: Glob.IOptions, callerDefaultOpts: Glob.IOptions): Glob.IOptions
  • Parameters

    • opts: Glob.IOptions
    • callerDefaultOpts: Glob.IOptions

    Returns Glob.IOptions

normalizeTempFileOptions

size

  • size(path: string | Buffer, useLSTAT?: boolean): Promise<number>
  • Returns the size of a file system element.

    Parameters

    • path: string | Buffer

      The path to the element.

    • Default value useLSTAT: boolean = true

    Returns Promise<number>

    The promise with the size.

sizeSync

  • sizeSync(path: string | Buffer, useLSTAT?: boolean): number
  • Returns the size of a file system element (sync).

    Parameters

    • path: string | Buffer

      The path to the element.

    • Default value useLSTAT: boolean = true

    Returns number

    The size.

tempFile

  • tempFile<TResult>(action: function, opts?: TempFileOptions): Promise<TResult>
  • Invokes an action for a temp file.

    Type parameters

    • TResult

    Parameters

    • action: function

      The action to invoke.

        • (file: string): TResult | PromiseLike<TResult>
        • Parameters

          • file: string

          Returns TResult | PromiseLike<TResult>

    • Optional opts: TempFileOptions

    Returns Promise<TResult>

    The promise with the result of the action.

tempFileSync

  • Invokes an action for a temp file (sync).

    Type parameters

    • TResult

    Parameters

    • action: function

      The action to invoke.

        • (file: string): TResult
        • Parameters

          • file: string

          Returns TResult

    • Optional opts: TempFileOptions

    Returns TResult

    The result of the action.

toTmpSimpleOptions

tryUnlinkTempFile

Generated using TypeDoc