Skip to content

Instantly share code, notes, and snippets.

View tscislo's full-sized avatar
😃

Tomasz Ścisło tscislo

😃
View GitHub Profile
const fs = require('fs');
// Function to read file and extract lines starting with given prefixes
function extractLinesWithPrefixes(filePath, prefixes) {
// Read the file
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading file:', err);
return;
}