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

When used as a library, return a Promise #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

addam
Copy link

@addam addam commented Jun 3, 2022

The main function obj23dtiles(objPath, outputPath, options) used to return undefined, although there is much asynchronicity properly used inside of it. Because of this, it was not possible to properly wait on completion -- the only option would be to spawn node in a child process and wait for it to exit.

This pull request makes the relevant Promise to be returned outside, so that it is possible to just await obj23dtiles(...).

Note, other issues may arise from process.exit being used in the library code. Such calls should be moved to bin/obj23dtiles.js solely but I tried to keep this pull request as humble as possible.

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

Successfully merging this pull request may close these issues.

1 participant