A UPS can give you a chance to save your work when the power goes out, and even keep things like your router and modem running for an hour or so, until the power (hopefully) comes back on. Amazon actually sells its own UPS units under the AmazonBasics umbrella, and this 800VA 450W model is down to $52 right now, the best price since the holidays.
For comparison, this CyberPower model with a similar size battery (albeit with more bells and whistles) sells for over twice as much.