Commercial codes have required emergency lighting for decades. I've added a couple of inexpensive ones at home.
First one I bought is an Energizer from Tractor Supply. Plugs into any socket and maintains a charge. If power goes out, light goes on. Yesterday I was in Home Dept and bought a $10 Capstone Eco i Lite that does the same thing and has a night light. What is nifty is it has an induction charger so no contacts to make when taking it out or putting it back in the holder. Charge is supposed to last 4 hours.
Of course, I have other flashlights and an LED lantern, but if the power goes out suddenly, we won't be in total darkness trying to find a light.