Handle directory as input to the cli
Most projects would likely have a image/asset folder where images will be saved. Lowly should handle cases for having directory inputs. Lowly cli will parse all images in the given input directory and create lower resolution images for the same in the same directory.
Pull request #3 is intended to handle such cases.
Sure @thinker3197, but you can compile all the files inside a directory using a glob syntax:
# All files and directories inside the folder image
$ lowly images/**/*
# All files inside the folder images, not including files in subfolders
$ lowly images/*
# All files with jpg, png and jpeg as extension inside the folder images, including subfolder
$ lowly images/*.{jpg,png,jpeg}
I like this syntax, but some people think that it can be more user-friendly if the asterisks are not included sindresorhus/globby#33
What do you think @thinker3197? Leave as it is, just including more examples in the readme? Or change the behaviour of the cli?
Oh, I didn't see that you were using globby. If it suits you, we can stick to that and make it a bit more clear in the README (like giving examples and sample code snippets). If not, I've made this pull request to do the exact same thing (with a few more improvements on the way).
Also, I was concerned how does lowly handles file types, like a directory can have both image and non-image files. So we might wanna check the MIME type of files before working on them to make sure lowly only operates on image files and nothing else.
I've implemented the MIME checking, on my forked repo if you wanna have a look 🔎