objTo3d-tiles
objTo3d-tiles copied to clipboard
When used as a library, return a Promise
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.