scramjet icon indicating copy to clipboard operation
scramjet copied to clipboard

BufferStream/StringStream fromFile / toFile methods.

Open MichalCz opened this issue 4 years ago • 1 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))

MichalCz avatar Oct 10 '20 15:10 MichalCz

Ok, slight mod... should be fromUri?

MichalCz avatar Dec 03 '20 11:12 MichalCz