image-pixels
image-pixels copied to clipboard
Sync API
Sometimes that is useful to avoid async/await code: there is readFileSync, even sync request, image-decode has sync API, so the only necessity in sync is browser-based primitives, not completed Image, Blob etc.
Just wonder - how bad the practice of returning Promise along with the ready result is. That seems trivial for people who care about async API just do
Promise.resolve(pixels(src)).then(data => {})
and who needs sync fashion for everything just do as it is now:
var data = await pixels(src)
but that enables sync API as well, instead of Promises:
var data = pixels(path)
That would allow for simple image-equal API eh...
eq('./a.js', arr)