MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / readFirstLine

Function readFirstLine

cli.js:1600–1609  ·  view source on GitHub ↗
(/** @type {string} */ filepath)

Source from the content-addressed store, hash-verified

1598 spinner.start()
1599
1600 async function readFirstLine(/** @type {string} */ filepath) {
1601 const inputStream = fsCb.createReadStream(filepath)
1602 try {
1603 for await (const line of readline.createInterface(inputStream))
1604 return line
1605 return '' // If the file is empty.
1606 } finally {
1607 inputStream.destroy() // Destroy file stream.
1608 }
1609 }
1610}
1611
1612function assertSchemaValidationJsonHasValidSkipTest() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected