Bring a large pot of well-salted water to a gentle boil. In a large bowl, whisk together the flour, salt, and optional nutmeg. Make a well in the center, then add the eggs and milk. Stir with a wooden spoon until a thick, sticky batter forms. Beat firmly for about 1 minute, until the batter looks smooth and elastic. Let it rest while you prepare the onion.
Melt 1 tablespoon (14 g) butter in a large skillet over medium heat. Add the sliced onion and a pinch of salt. Cook, stirring often, until deeply golden and soft. Transfer half of the onions to a plate for topping and keep the rest in the skillet.
Hold a spaetzle maker, large-holed colander, or sturdy box grater over the gently boiling water. Working in batches, press or scrape about one-third of the batter through the holes into the water. Stir gently so the noodles do not stick together.
When the spaetzle float to the surface, cook for 1 more minute. Lift them out with a slotted spoon, draining well, and add them to the skillet with the remaining onions. Repeat with the remaining batter.
Add the remaining 1 tablespoon (14 g) butter to the skillet. Toss the hot spaetzle gently, then sprinkle in the shredded cheese in two additions, tossing until melted and evenly distributed. If the skillet is crowded, cover it briefly over low heat to help the cheese melt.
Season with black pepper. Spoon into bowls and top with the reserved browned onions and optional chives or parsley. Serve hot.