In other languages, there are finalisers (also called destructors) that are called when the object is about to be collected by GC. This can be very useful to detect certain kind of bugs related to lifetimes of objects.
Is there a way to get this behaviour on NodeJS — on JS level, not through native interface?