Yes, that is perfectly possible. And that is what I'd do for something that was more "live" than "dev". On my dev instance, I simply put
require in to save faffing with settings.js
If doing it that way, you have to change your function node code to get the module from the global variable instead of using require of course.
Such things should still be used sparingly if you have multiple people who may edit your flows. But if it is just you at home and you don't connect the Editor to the Internet, all should be OK in any case.
Just a final note that not all node.js packages like being handled that way, you might occasionally come across one that doesn't work. Most seem to though.