sindresorhus / get-stdin

Get stdin as a string or buffer
MIT License
337 stars 28 forks source link

Unify how to get stdin #23

Closed Kikobeats closed 7 years ago

Kikobeats commented 7 years ago

I unified the main method for get the stdin and added a serializer method for determinate if you want an string or buffer output.

Also new BufferBuffer.from 😄

sindresorhus commented 7 years ago

It's separate methods as progressively concatenating a string is better than converting a buffer to a string at the end. The latter can be a heavy blocking operation for large inputs.