Unix pipes are a powerful tool. In Emacs we don't have much support for them so this package aims to add such support.
The Pipe API consists of a few functions and macros to spawn processes and communicate with them in the Pipe style.
A macro allowing piping to be represented simply:
(pipe "ls -la" (catch :eof (with-current-buffer somebuf (-each (->> (pipe-read) (-keep (lambda (a) a))) (lambda (x) (print x)))
pipe takes a command as a string and a body of code which is executed with (pipe-read) providing a line from the command.
Has proc been marked EOF?
Pipe the shell command to the thunk function.
Within thunk the function pipe-read is bound to deliver whatever came over the pipe.