-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promisify Functions #486
Promisify Functions #486
Conversation
7aa216c
to
84e1289
Compare
84e1289
to
41db402
Compare
@oliver-moran If you just merge this one all #473 and #477 will be merged as well |
@oliver-moran and if this one gets merged 10 issues get closed all at once 😮 |
I think I'm gonna change it from |
@oliver-moran Just added the 'async' functions. They are tested and documented. Everythings runs fine. This should be ready to go! |
0cd8f77
to
a81556c
Compare
@edi9999 what do you think of this one? it gets makes of the requested functions promises without breaking the current api |
in this MR I find that the duplication in the code is not good for maintanability. Things like Bluebird can do the automatic transformation from callback to Promises. |
So should I use bluebird to do this? Or you want users to do that? I think it would be better just to have it supported. The code isn’t really duplicated either. I factored out the main functionality of each function and the sync and a sync functions just call them in different ways |
85ab25c
to
1718d3f
Compare
1718d3f
to
c463d09
Compare
@edi9999 Switched to an implementation that just calls the current functions and return a promise. Similar to |
@edi9999 have i fixed your duplication concerns? |
You can even just do it like this :
This way the "promisification code" is just in one place. |
@edi9999 added |
I see this closes #445 and some talk about |
You can just use https://github.com/oliver-moran/jimp/blob/master/src/index.js#L810 |
Request update "jimp.d.ts" file defines. |
@septs what updates are you requesting ? |
closes #232 - write now can return a promise
closes #90 - same as above and getBuffer can now be async
closes #374 - base64 can now be async
closes #308 closes #445 - Jimp.read can take all args that the constructor can. Jimp.create added for clearer syntax. No need to add promises to the jimp constructor.