The dry-goods section of your local supermarket undoubtedly has several shelves dedicated to dried pasta, ranging from ordinary mass-market brands to expensive, upscale imports. The refrigerated deli section has sheets of fresh pasta, much like the ones you'd make at home. Your homemade noodles, or store-bought fresh pasta if you have leftovers, will spoil after just a few days. If you dry them instead of refrigerating the noodles, they'll remain edible for weeks despite their egg content.
Dried Versus Fresh
There are large differences in how the two kinds of pasta are made. Commercial dried pasta is prepared with flour made from durum wheat, an ancient variety that's very high in gluten-producing proteins. It makes a very stiff dough that's best handled by large machines, and it's strong enough to make a robust pasta with no other ingredient but water. Fresh pasta is made at home from ordinary flour, rather than the high-gluten durum variety. The protein necessary to keep it from cooking to mush when it's boiled comes from eggs, rather than the flour itself.
Making Your Fresh Pasta
The traditional method is to mound flour on your counter, make a well in the middle, and crack eggs into the well. As you mix in the eggs, you gradually draw flour from the edges of the well until you create a stiff dough. Modern stand mixers speed that process, using a dough hook to mix the eggs and flour together. Then the dough is pressed through adjustable rollers, making a thinner and longer sheet each time, until it's cut or shaped into noodles. If you think that's a lot of work for one meal, you're right. Accordingly, cooks often make up enough for several meals and dry the pasta for later use.
Eggs and Food Safety
The idea of leaving egg-based pasta to sit at room temperature might seem counterintuitive from the food safety perspective, but it really isn't. Bacteria require a certain amount of available moisture -- referred to in food safety circles as free water -- to reproduce. Thin sheets of fresh pasta dry quickly enough that harmful bacteria don't have time to get established, leaving the noodles as safe as beans, beef jerky or other well-dried foods. As long as the pasta is fully dried and stored in airtight packaging, it's safe for months. In practical terms, though, it tastes best if used within four to six weeks.
The Quality Thing
Much of the charm of fresh-made pasta is in its delicate flavor, and that doesn't last as long as the pasta's physical lifespan. The egg yolks contain fat, which will oxidize and begin to develop unfortunate flavors after the first several weeks. The dried noodles are also exceptionally fragile, and the longer you store them the more likely you are to end up with an unappealing mound of noodle fragments. For long-term storage, freezing is a better idea. Dust the noodles with flour and layer them on parchment paper, to keep them from sticking together, and freeze them on a flat baking sheet. Once they're frozen, layer them into a rigid freezer container that will protect them from accidental damage. Frozen pasta retains its quality for up to six months.