Open gustavnikolaj opened 9 years ago
I think we would need to pass in the file name, file extension or explicitly desired transpiler for it to know which one to apply.
A tolk readStream method should probably also return a steam wrapped promise for pipes to continue working
Of course, you'd need at least the file name in order for this to work in the same way as .read
. Hmm...
I assume that you also use the path to the file to resolve fx. includes in a sass file?
Right. Forgot about that. Sass the includePaths. It's very tied to the file system, which is also the reason why my sass compiling express middleware does not use hijackresponse
The main reason I needed stream support was to build a middleware that relied on the static middleware to get the files for me. I guess we could just skip that idea and handle file loading in the middleware itself. If it's needed for sass anyway, I guess it would be hard to get them to blend any way.
It would be nice to get the benefits of express-static behind it though. Then you wouldn't have to reimplement your own caching as well. I just don't really know how
As we talked about, this would allow us to more easily integrate it into an express middleware.
I was considering something like this.
I also thought about making tolk into a writable stream. That would allow you to pipe to it, but it may be too invasive. I don't know..