frontend-standards-checker
Version:
A comprehensive frontend standards validation tool with TypeScript support
17 lines • 490 B
JavaScript
import nthline from 'nthline';
/**
* Gets a specific line from a file (1-based index).
* Returns undefined if the line or file does not exist.
*/
export async function getLineFromFile(filePath, line) {
if (!filePath || !line || line < 1)
return undefined;
try {
const content = await nthline(line, filePath);
return content !== undefined ? content : undefined;
}
catch {
return undefined;
}
}
//# sourceMappingURL=getLine.helper.js.map