Hi all,
I’d like to share lines (github.com/mzattahri/lines), a library for reading, searching, and modifying text sources on a per-line basis. It uses iterators and simple abstractions that make it ergonomic to traverse, filter, rewrite, or transform text line by line.
What it does:
(a) Iterate over all lines (forward or backward), or head/tail subsets.
(b) Search/filter lines by content or custom predicates.
(c) Modify files in place (replace, remove, insert, truncate) or rewrite/transform them safely using a buffered rewrite or streaming.
(d) Maintain 1-based line numbering consistently (even when iterating backwards or slicing).
Why it might be useful:(1) For tooling that deals with text files (config files, logs, code, data), where you often want to inspect or change specific lines without rewriting the whole file manually.Thoughts and feedback are welcome.