Thinly slice the onions. This step is key—take your time to get even slices for uniform caramelization.
Place the sliced onions in your slow cooker. Add the olive oil or butter, salt, and optional sugar. Stir to coat the onions evenly.
Cover and cook on low for 8–10 hours, stirring occasionally, until the onions are deep golden brown and perfectly caramelized.
About 30 minutes before the onions are finished, add the minced garlic, thyme, rosemary, and white wine or vegetable broth. Stir to combine and continue cooking until fragrant and fully incorporated.
While the onions finish cooking, prepare your pasta according to package instructions. Reserve 1 cup of the starchy pasta water before draining.
Toss the cooked pasta with the caramelized onions. Add reserved pasta water gradually to create a silky, luscious sauce that coats each strand of pasta.
Stir in the grated Parmesan cheese, adjusting salt and pepper to taste.
Serve immediately, garnished with freshly chopped parsley for a bright, fresh finish.
Enjoy!