You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for sharing this library. I'm opening this to discuss whether and how spawnAsync could support exposing the raw binary stdout content.
My use case is the following: I am using [pandoc] to convert HTML content to a binary format (.docx in my case). Pandoc outputs the raw docx content to stdout, but since spawnAsync concatenates the output in a string, the binary content is scrambled which makes the docx corrupted (probably because concatenating the binary output to a string force-converts to utf8).
For this reason I couldn't use spawnAsync and had to use the built-in spawn function and basically reimplement error handling and reading from the process stdout stream.
Of course we don't want this change to break backwards compatibility, so SpawnResult.stdout should still contain a string.
What I'd imagine is a new attribute on SpawnResult containing the raw Buffer[] content, e.g.:
This sounds reasonable. I like the idea of adding new properties rather than doing what Node does with spawnSync where stdout/stderr can be either strings or Buffers based on the encoding option. Could you add rawStdout and rawStderr along with tests for both?
Hi!
First, thanks for sharing this library. I'm opening this to discuss whether and how
spawnAsync
could support exposing the raw binary stdout content.My use case is the following: I am using [pandoc] to convert HTML content to a binary format (
.docx
in my case). Pandoc outputs the raw docx content to stdout, but sincespawnAsync
concatenates the output in a string, the binary content is scrambled which makes the docx corrupted (probably because concatenating the binary output to a string force-converts to utf8).For this reason I couldn't use
spawnAsync
and had to use the built-inspawn
function and basically reimplement error handling and reading from the processstdout
stream.Of course we don't want this change to break backwards compatibility, so
SpawnResult.stdout
should still contain a string.What I'd imagine is a new attribute on
SpawnResult
containing the rawBuffer[]
content, e.g.:I'd be happy to work on this, if this sounds like a reasonable feature to add!
The text was updated successfully, but these errors were encountered: