hammerspoon2-docs
    Preparing search index...

    Function readLines

    • Read a file line-by-line, invoking a callback for each line. Lines are delivered with newline characters stripped. Both \n and \r\n line endings are handled.

      Parameters

      • path: string

        Path to the file. ~ is expanded.

      • callback: (line: string) => boolean

        Called once per line with the line text. Return true to continue reading, or false to stop early.

      Returns boolean

      true if the file was read successfully (including early stops requested by the callback), or false if the file could not be opened.