express-sse
express-sse copied to clipboard
Ability to not JSON.stringify simple strings
For simple strings like sse.send("Test string")
, you get the following output:
id: 0
data: "Test string"
However it is perfectly valid to have, and perhaps more common to have:
id: 0
data: Test string
If this representation is desired however, it is not possible to get it currently using express-sse.
I think that's simple to do.
const stringify = (val) => typeof val === 'string' ? val : JSON.stringify(val)
Ah, just do it with PR