goldies
    Preparing search index...

    Function readFile

    • Reads a file and returns a promise that resolves with the file's contents.

      Parameters

      • path: string

        The path of the file to read.

      Returns Promise<string>

      A promise that resolves with the file's contents.

      const fileContents = await readFile('/path/to/file.txt');
      

      Use readFile(path, 'utf8') from node:fs/promises, which this calls. Will be removed in goldies 6.0.