vutran / os-fonts

Retrieve fonts available on your OS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If folder does not exist on a platform then it errors

niftylettuce opened this issue · comments

I believe that if we pass useType to be network, and the path does not exist for the network folder, then we should return an empty array instead of throwing an error (because path.join and fs.readDir are reading a director that does not exist. Perhaps you could modify the code so that it checks fs.stats if the directory exists, and if not return an empty array.

This should be fixed in this patch here.

thank you very much for the speed with these, it's really nice to hear back so quick and to have your help. I'm using this for https://github.com/crocodilejs/custom-fonts-in-emails which I'm writing tests for now (the Readme has changed a lot since I pushed initial commit)

@niftylettuce That's a pretty cool project you have there. Would be super useful to generate custom buttons. Looking forward to see your module take shape and mature.