Function readFile

  • Asynchronously reads the entire contents of a file.

    Parameters

    • this: V_Context
    • path: PathLike | FileHandle
    • Optionaloptions: null | { encoding?: null; flag?: OpenMode }

    Returns Promise<Buffer>

    the file data

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

    flag Defaults to 'r'.

  • Asynchronously reads the entire contents of a file.

    Parameters

    • this: V_Context
    • path: PathLike | FileHandle
    • options: BufferEncoding | { encoding: BufferEncoding; flag?: OpenMode | undefined }

    Returns Promise<string>

    the file data

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

    flag Defaults to 'r'.

  • Asynchronously reads the entire contents of a file.

    Parameters

    • this: V_Context
    • path: PathLike | FileHandle
    • Optionaloptions: null | BufferEncoding | ObjectEncodingOptions & { flag?: OpenMode | undefined }

    Returns Promise<string | Buffer>

    the file data

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

    flag Defaults to 'r'.