See: https://github.com/SoniEx2/loadx/
Ok, loadx is nice.
But where is dumpx?
The problem is that when you're writing Lua code, it's hard to predict what would be the order of upvalues inside a function.
And it's a chance to accidentally swap upv1 and upv2 every time when you're modifying the Lua code of the function.
That's why your loadx needs its counterpart dumpx to easily receive all upvalues in their correct order.