provide an interface to access generated output more as a stream

Can you add an easy example illustratring how this function is supposed to be used? It's not immediately obvious from the documentation.