utf8-stream
buffer utf8 characters that would otherwise span chunk boundaries
example
Here we'll write some chinese characters at random byte offsets:
var utf8Stream = ;var through = ;var u8 = ;u8;u8;u8;u8;u8;u8;u8;
Inside the through(function (buf) {})
, each buf
will never span a utf8
multi-byte character so we can just call .toString('utf8')
.
output:
遙
遠
未
來
的
事
件
methods
var utf8Stream =
var u8 = utf8Stream()
Return a through stream u8
that will never emit a chunk that spans a utf8
multi-byte character.
install
With npm do:
npm install utf8-stream
license
MIT