Here's some good news for those with emergency sugar cravings: the country's first cupcake ATM.

Los Angeles-based Sprinkles bakery promises its new automated endeavor -- known as 24-Hour Sprinkles -- will be stocked daily with freshly baked cupcakes and cupcake mixes.  Also available are freshly baked treats for pets and apparel, reports LAist.

The machine will be the divider between Sprinkles Cupcakes store and the new Sprinkles Ice Cream store --both located in the center of Beverly Hills.

And don't despair if you're not in the LA area. Sprinkles Cupcakes told the New York Daily News that it's planning on opening several automated cupcake dispensaries in Manhattan by the summer.

“We’re working hard on the exact locations now,” spokeswoman Nicole Schwartz told the Daily News. “They’ll be restocked constantly throughout the day, so if it’s Wednesday, you’ll only get our Wednesday flavors.”

The idea for cupcake ATM came from company founder Candace Nelson, a judge of Food Network’s “Cupcake Wars.” when she was struck with a late-night sugar craving during one of her pregnancies and she had nowhere to go.

“I thought there has to be a way, and so the concept of 24-hour Sprinkles was born,” Nelson told The News.