scramjetorg / scramjet

Public tracker for Scramjet Cloud Platform, a platform that bring data from many environments together.

Home Page:https://www.scramjet.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BufferStream/StringStream fromFile / toFile methods.

MichalCz opened this issue · comments

Is your feature request related to a problem? Please describe.

Every time we need to parse a file there's a lot of code needed.

Describe the solution you'd like

This should work:

StringStream.fromFile('./path/to/file', {encoding: 'utf-8'})
    .lines()
    .reduce((sum, x) => sum + (x ? 1 : 0))

Ok, slight mod... should be fromUri?