isaacs / sax-js

A sax style parser for JS
Other
1.09k stars 325 forks source link

add partial text events #271

Open rishair opened 4 months ago

rishair commented 4 months ago

Problem

When streaming strings to the parser, it can be useful to receive partial text events to get results before a full textNode is returned.

Use Case

Especially useful when receiving tokens from an LLM and wanting to stream the XML response as it appears.

Tests