Function readFile

  • Asynchronously reads the entire contents of a file.

    Parameters

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

      If no encoding is specified, then the raw buffer is returned.

    Returns void

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

    flag Defaults to 'r'.

  • Parameters

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

    Returns void

  • Parameters

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

    Returns void