Options
All
  • Public
  • Public/Protected
  • All
Menu

Callable

  • readFile(path: PathLike | number, options: object | undefined | null, callback: function): void
  • readFile(path: PathLike | number, options: object | string, callback: function): void
  • readFile(path: PathLike | number, options: object | string | undefined | null, callback: function): void
  • readFile(path: PathLike | number, callback: function): void
  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. If a file descriptor is provided, the underlying file will not be closed automatically.

    • options: object | undefined | null

      An object that may contain an optional flag. If a flag is not provided, it defaults to 'r'.

    • callback: function

    Returns void

  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically.

    • options: object | string

      Either the encoding for the result, or an object that contains the encoding and an optional flag. If a flag is not provided, it defaults to 'r'.

    • callback: function

    Returns void

  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically.

    • options: object | string | undefined | null

      Either the encoding for the result, or an object that contains the encoding and an optional flag. If a flag is not provided, it defaults to 'r'.

    • callback: function

    Returns void

  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. If a file descriptor is provided, the underlying file will not be closed automatically.

    • callback: function

    Returns void

Index

Functions

Functions

__promisify__

  • __promisify__(path: PathLike | number, options?: object | null): Promise<Buffer>
  • __promisify__(path: PathLike | number, options: object | string): Promise<string>
  • __promisify__(path: PathLike | number, options?: object | string | null): Promise<string | Buffer>
  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. If a file descriptor is provided, the underlying file will not be closed automatically.

    • Optional options: object | null

      An object that may contain an optional flag. If a flag is not provided, it defaults to 'r'.

    Returns Promise<Buffer>

  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically.

    • options: object | string

      Either the encoding for the result, or an object that contains the encoding and an optional flag. If a flag is not provided, it defaults to 'r'.

    Returns Promise<string>

  • Asynchronously reads the entire contents of a file.

    Parameters

    • path: PathLike | number

      A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically.

    • Optional options: object | string | null

      Either the encoding for the result, or an object that contains the encoding and an optional flag. If a flag is not provided, it defaults to 'r'.

    Returns Promise<string | Buffer>

Generated using TypeDoc