Preheat oven to 350°F (175°C). Grease a muffin tin or mini cake molds.
In a large bowl, whisk together flour, sugars, baking powder, baking soda, cinnamon, nutmeg, and salt.
In another bowl, whisk eggs, oil, and vanilla extract until smooth.
Add the wet ingredients to the dry ingredients and stir until just combined.
Fold in grated carrots, and if using, pineapple and nuts.
Divide the batter evenly into prepared molds.
Bake for 20–25 minutes or until a toothpick inserted comes out clean.
Let cool in the pan for 10 minutes, then transfer to a rack to cool completely.
For the frosting, beat cream cheese and butter until smooth. Add powdered sugar, vanilla, and a pinch of salt. Beat until fluffy.
Once cakes are cool, frost and decorate as desired.