Motivation
----------

The goal of this small package is to provide a interface for streaming data to
and from child-processes. It may be possible to stream data to a process via stdout
and read the result from stdin, but it may also be necessary to store the data in a
temporary file and provide the filename to the process as argument.

A concrete example is ffmpeg: It is possible to encode webm-videos to a stream,
but h264 must always be stored in a temporary file first. On the other hand in some cases
[it is not possible to stream data into ffmpeg](http://superuser.com/questions/822500/pipe-issue-with-ffmpeg),
so data must be stored in a temporary file prior to calling ffmpeg.



Overview
--------

ProcessStreams provides the methods `exec`, `execFile` and `spawn` from the `child_process` with the same arguments.
The return value however is always a through-stream. The command line arguments are examined for occurences of
the strings `<INPUT>` and `<OUTPUT>`.

 * If `<INPUT>` is present, the stream input is piped into a temporary file and `<INPUT>` is replaced by its filename.
 * If `<OUTPUT>` is present, it is replaced by the name of a temporary file and the contents of this file is
 used as stream output for the resulting stream.
 * If `<INPUT>` or `<OUTPUT>` are not present, the stream input is directly piped to the child processes stdin
 (or the child processes stdout is piped to the stream output).

Temporary files are always deleted when no longer needed.
