Do not peel the onions but put them in a saucepan and add water to cover and salt to taste. Bring to the boil and simmer until tender, 15 to 20 minutes. Drain, but reserve 1cup of the cooking liquid. Peel the onions.
Heat the butter in a saucepan and add the flour, stirring with a wire whisk. When blended, add the reserved onion liquid, stirring rapidly with the whisk. When blended and smooth, add the cream, nutmeg, salt, black pepper, thyme, and cayenne. Add the onions.
Just before serving, bring to the boil and stir in the peanuts, if desired. Serve immediately.