Function readFile

  • Asynchronously reads the entire contents of a file.

    Parameters

    • filename: PathLike
    • cb: Callback<[Uint8Array]>

    Returns void

    Option

    options encoding The string encoding for the file contents. Defaults to null.

    Option

    options flag Defaults to 'r'.

  • Parameters

    • filename: PathLike
    • options: {
          flag?: string;
      }
      • Optional flag?: string
    • Optional callback: Callback<[Uint8Array]>

    Returns void

  • Parameters

    • filename: PathLike
    • options: BufferEncoding | {
          encoding: BufferEncoding;
          flag?: string;
      }
    • cb: Callback<[string]>

    Returns void