readToString static method

FutureResult<String, IoError> readToString(
  1. Path path
)

Reads the entire contents of a file into a string.

Implementation

static FutureResult<String, IoError> readToString(Path path) async {
  return Fs.ioGuard(() async {
    return await File(path.asString()).readAsString();
  });
}