how to write node programs with streams