`writeEPUB` pipe support
erikbrinkman opened this issue · comments
Currently writeEPUB
takes a directory and filename, but it'd be nice to be filesystem agnostic and allow outputting to a buffer or pipe. This seems relatively, and I'd be happy to submit a PR but I wanted to gauge support first.
Personally I have no need for pipe support, and nobody has suggested it before now. Given that, I would be reluctant to take the change without a clear reason as no matter how simple it might be I don't feel comfortable adding extra functionality based on it being "nice".
This isn't to be dismissive; if the reason you would find it nice is something that would also be of clear benefit to others then that's fair enough and I'd consider a PR. My usual stance though is that every feature added is extra support, maintenance, and even conceptual overhead further down the line, so anything but bug fixes needs to be of quite clear benefit in order to allow that extra friction going forward.
For my own uses I've just forked and made the necessary changes, since clearly there are a few things I wanted to change.
The goal was making this node/filesystem agnostic so that inputs could all reside in memory as would outputs. It's pretty clear that this sort of thing is out of scope for node-pub so no worries!
I think you got it right with it being out of scope. After consideration it seems like Nodepub's remit is to create EPUBs from content, and how that content arrives (file system, pipe) is the concern of the calling code.
In order to support that principle, though, it does feel right that images can be inlined as you suggested given that they really do depend currently on the filesystem and Nodepub is breaking out of it's domain by loading them.