Function: readFirstJsonlRecords()
Makaio Framework / ai-adapters-core/node / readFirstJsonlRecords
Function: readFirstJsonlRecords()
Section titled “Function: readFirstJsonlRecords()”readFirstJsonlRecords<
T>(filePath,maxRecords):Promise<T[]>
Defined in: ../../../adapters/core/src/log-importer/jsonl-parser.ts:241
Read the first N JSON records from a JSONL file.
Optimized for discovery: reads only enough bytes to find maxRecords
complete JSON lines, then stops. Uses a small buffer to avoid reading
entire large files.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”filePath
Section titled “filePath”string
Absolute path to the JSONL file
maxRecords
Section titled “maxRecords”number
Maximum number of records to return
Returns
Section titled “Returns”Promise<T[]>
Array of parsed JSON records (skips malformed lines)