Polyman Documentation - v2.2.2
    Preparing search index...

    Function readFirstLine

    • Reads the first line of a file efficiently using streaming. Useful for reading verdict from validator/checker output.

      Parameters

      • filePath: string

        Path to the file

      Returns Promise<string>

      First line of the file

      If file cannot be read

      const verdict = await readFirstLine('/tmp/validator_output.txt');
      // Returns: 'VALID' or 'INVALID'