UNPKG

eslint-plugin-readable-tailwind

Version:

auto-wraps tailwind classes after a certain print width or class count into multiple lines to improve readability.

24 lines 765 B
import { createReadStream } from "node:fs"; export async function fileContainsString(filePath, searchString) { const stream = createReadStream(filePath, { encoding: "utf-8" }); // stream.setEncoding("utf-8"); let remainder = ""; try { for await (const chunk of stream) { const data = remainder + chunk; if (data.match(searchString)) { console.log("Didn't match: ", filePath); stream.destroy(); return true; } console.log("Matched: ", filePath); remainder = data.slice(-searchString.length); } } catch (err) { stream.destroy(); return false; } return false; } //# sourceMappingURL=stream.js.map