pgriess / node-strtok

A streaming tokenizer library for NodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

question: how to handle BufferType when the actual data coming is less than expected?

andrewrk opened this issue · comments

See for example leetreveil/musicmetadata#27

We need to listen to the 'close' event from the stream to learn when we get less bytes than we expected. Where is the correct place to do that? In strtok or in the code that uses strtok?

I think it makes sense for the code to go in the code that uses strtok.