Refactoring dumping node.json process to work correctly