Fixed end value when creating stream

Start value should be lower or equal with end value. When buffer length is 0 (empty file), this snippet was throwing an error. After this change we substract one unit if the buffer length is not 0. Fixes #131 

I also did a `npm init` to reformat `package.json` with the new npm syntax. Also, added myself as contributor. :smile: