Skip to content
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

async/await vs. callback #38

Open
a7i opened this issue Sep 25, 2020 · 5 comments
Open

async/await vs. callback #38

a7i opened this issue Sep 25, 2020 · 5 comments

Comments

@a7i
Copy link
Contributor

a7i commented Sep 25, 2020

Would you be open to supporting promises vs. callbacks? I realize there are many considerations including API backward compatibility.

I would be happy to contribute an async approach if this aligns with future plans for this library (i.e. async/await).

@elwerene
Copy link
Owner

Honestly I'm just keeping the library alive by answering to issues/pull requests and releasing new versions without coding myself. I'm open to release a major/breaking update with promises.
But we should cleanup the API while doing so and have a look on all open issues like #17 and #22
@a7i Would that be something you want to do? I will happily review your changes and release them once they are ready :)

@ilkohoffmann
Copy link

ilkohoffmann commented Nov 13, 2020

@elwerene -> I have played around a bit with your library on OSX and did some refactoring. I have basically translated the code to Typescript and removed the async-library to improve its readability. I also tried to simplify the Converter-API. It´s now expecting an ConverterOptions object to be passed in which can be further extended. I didn´t write any tests so far but it works fine at least on my OS. I also experienced performance issues on Windows OS using the master branch although I think this is rather caused by the binary and runtime environment and not by the library itself.

Feel free to have a look at: https://github.com/ilkohoffmann/libreoffice-convert/tree/refactoring

@elwerene
Copy link
Owner

@ilkohoffmann oh wow, that could form the basis for a promising (pun intended) 2.0 release :)

@ilkohoffmann
Copy link

@elwerene 2.0 sounds good to me ;) Let me know how you want to proceed. I have done some more refactoring and added the missing test. I have removed the Promise<Buffer> return value and a few (imo) unecessary buffer-to-file and file-to-buffer conversions. Now the library is doing the conversion and the storage on the filesystem only. Before my changes it converted the office file to a pdf file and generated a buffer of this file afterwards.

@elwerene
Copy link
Owner

I'm open for pull requests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants