Closed Guuz closed 8 years ago
I like that Idea. I never ran into such a situation myself, but it makes complete sense to be a bit more friendly about that :) I would suggest to move the root-verification into the getNativeBindings
-function, similar to what is happening with the raspberry-detection.
getNativeBindings()
makes sense yes! I think it's very bad for a 3th party lib to call process.exit().
You are right. Would be better to just throw an exception or handle it gracefully (like it is currently done for non-pi architectures). The consuming library will then either have to catch and handle it or will die anyway with an uncaught exception. Would be great of you could create a PR for this if you find the time.
I'm on it!
@usefulthink I changed the implementation a bit compared to what we talked about here. But i think it's better this way. I hope you agree! If not I'm happy to change it.
Hello,
I'm using this module in my app and stumbled upon the following. During development I don't want to run as root (why should i?) and I cant really use this module anyway because it only works on a Pi. The code here logs to
strerr
and exits the process. This is not very friendly for a consumer.I would propose we throw an error that the consumer can detect and ignore during development. Maybe the mock implementation could be made available to use too.
Curious to hear what your opinion is on this! I can work on a PR if we come to a solution.