shannonmoeller / handlebars-wax

The missing Handlebars API for data, partials, helpers, and decorators.
http://npm.im/handlebars-wax
MIT License
40 stars 9 forks source link

Allow hb-wax to work with a different filesystem #14

Open MikeLindenau opened 6 years ago

MikeLindenau commented 6 years ago

I use s3 as my filesystem so while I want to use wax, cant as it is obviously based on local fs. Would love to discuss an approach to add the ability to pass in a fs binding.

shannonmoeller commented 6 years ago

Interesting idea. I'm currently making liberal use of fs.readFileSync. I'm guessing an s3 fs lib would need to run async?

MikeLindenau commented 6 years ago

ya working on below which I just put into a fork of wax... will share fork details when I have it working. Added a sync wrapper around read to work as a replacement for fs.readFileSync

https://github.com/Gumspace/remote-fs (super raw)

shannonmoeller commented 6 years ago

Will remote-fs support more than just s3? If not how does it compare to http://npm.im/s3fs?

MikeLindenau commented 6 years ago

Ya, so my use case requires the ability to be able to switch between local, s3, and possibly another remote fs. That said, I didn't find the above suggestion so thanks for sharing. I have actually used it now for the s3 bindings in remote-fs.

Please note though, I'm not suggesting any dependency or promoting the use or remote-fs. In fact its still very much just there to serve what I and not ready for general production use. I really just wanted to suggest wax be able to allow any binding that supports an fs interface you need.