Use mkdirp module. Move Renderer.save() method to Robot.saveFile().