Moves all functions to a class, whose constructor handles loading the native addon. This way, there won't be any side effects just from importing something from this library. This makes error handling much easier. To make it even better, we now throw a custom Error subclass that explains what to check for, and includes the original error in a field.
Moves all functions to a class, whose constructor handles loading the native addon. This way, there won't be any side effects just from importing something from this library. This makes error handling much easier. To make it even better, we now throw a custom
Error
subclass that explains what to check for, and includes the original error in a field.I also renamed a function that had a typo.