polotek/procstreams — pull request #17 by brynbellomy (2012-10-12 03:17:23+00:00)
Title: Making opts.cwd persist through chained calls

Basically what the title says. I really didn't want to barf all over your implementation, which is really elegant and concise, so I took as much care as I could in not adding unnecessary fields to objects, not repeating anything, etc. However, I did have to make a second call to `normalizeArguments()`, but to balance that out, I modified `procSteam()` so that the first argument could be an object containing the already-normalized argument fields. In this case, the call to `normalizeArguments()` is not made inside of `procStreams()` -- no code is actually run twice. It was the best workaround I could think of without doing some fundamental rewriting.

Let me know if you have a better idea about how to implement this -- I'm all ears.