Shell the fresh peas (if using), peel and finely chop the onion, cut the ham into small cubes/pieces, beat the eggs in a bowl with the grated Parmigiano.
If using fresh peas you will need to cook them in a little boiling salted water for 10 minutes before draining and adding them to the sauce. Fresh peas take longer to cook than frozen.
Put a pot of water on to boil for the pasta. Add salt once it starts to boil and bring to the boil again.
Cook the finely chopped onion in the butter or olive oil in a skillet or frying pan until translucent. Add cooked ham or prosciutto, and allow that to cook for a few minutes. Then, add the peas and cook for a couple of minutes more. If using fresh peas and they seem a little hard, add a little water and cook for a bit longer.
Then add the heavy cream (Italians use panna da cucina) and allow the cream to reduce a bit. Add ground black pepper and salt to taste.
Cook the pasta al dente according to the instructions on the packet. Fresh pasta will need only 1-2 minutes. When cooked, drain the pasta (but keep it a little wet) and add it to the cream sauce.
Then pour the beaten eggs and cheese over the pasta and sauce. Mix everything together well until the pasta is coated in a creamy sauce. Serve immediately, with generous sprinkling of ground black pepper and additional grated cheese if required.