A security camera captured the moment when a family was almost struck by lightning when leaving their home in New Jersey, US.