Closed abe33 closed 8 years ago
Looks great to me! /cc @atom/feedback for extra :eyes:
I'm wondering if I should also add a write stream method as well to be consistent. The returned write stream would be an iconv-lite
encode stream using the current file's encoding.
Sounds like a good idea to me :grinning:
ping @atom/feedback Any feedback on this?
@abe33 Just to update you, we're leaning towards merging this. We just want to have @zcbenz take a look before we give the final go-ahead :grinning:
Looks good to me. :+1:
Thanks @zcbenz!
Thank you @zcbenz!
The
File::read
method is already using a stream to process the file's content with iconv on the fly, but there's no way for the consumer of aFile
to get a read stream for the proper encoding - one can always use thefs
APIs to get a stream but it has to includeiconv-lite
as dependency if it want to behave the same as theFile
API.This PR adds a public
createReadStream
method on theFile
object that encapsulates the stream creation that was previously in theread
method.