happy-opfs
    Preparing search index...

    Function readTextFileSync

    • Synchronous version of readTextFile. Reads a file as a UTF-8 string.

      Parameters

      • filePath: string

        The absolute path of the file to read.

      Returns IOResult<string>

      An IOResult containing the file content as a string.

      readTextFile for the async version.

      1.1.0

      readTextFileSync('/path/to/file.txt')
      .inspect(content => console.log(content));