Preheat oven to 350°F. Line 2 standard muffin pans with 15 paper cupcake liners.
In a medium bowl whisk the sugar, flour, cocoa, espresso powder, baking powder, baking soda and salt. In a liquid measuring cup whisk together the milk, oil, egg, and vanilla. Add to the dry ingredients and whisk vigorously until the batter comes together. Add the coffee and stir until combined.
Fill each cupcake liner three-quarters full with batter. Bake until tops are firm and a cake tester inserted in the center comes out clean, 18 to 20 minutes. Transfer muffin pans to a wire rack and let cupcakes cool in pan for 10 minutes. Remove cupcakes from pan and let cool completely before frosting.
For the frosting:
In a large bowl, use an electric mixer to beat the butter on medium-high speed until light and fluffy, about 2 minutes. Add the powdered sugar, vanilla, peppermint extract, and cream with the mixer on low speed. Beat until incorporated then increase speed to high and beat for 3 minutes, or until ultra light and creamy. Add additional powdered sugar if frosting is too thin or additional cream if too thick.
Scoop the frosting into a large piping bag fitted with a plain open tip, such as the Ateco 804 or 806. Pipe the frosting onto the cooled cupcakes. Sprinkle with crushed candy canes. Serve or store in an airtight container in the fridge for up to five days. Bring to room temperature before serving if desired.