Melt the butter in a medium-sized saucepan over a medium heat. Add the shallots or onion and cook, stirring, for 4-5 minutes until softened. Add the frozen peas and vegetable stock and turn up the heat until the peas have thawed and are hot. Reduce the heat slightly and simmer for 5 minutes.
Stir in the fresh mint leaves and cook for a further 5 minutes. Spoon the mixture into a food processor and blend to a purée – stop blending when you have the consistency you like. Season generously, return to the saucepan and heat well. If you prefer, you can make the purée several hours in advance, then just tip it into a bowl, cover and chill in the fridge. Reheat when needed.