Preheat the oven to 300 degrees. Spread the cashews in a single layer on a baking tray and place in the center of the oven. Roast until golden (about 10 minutes), shaking the pan every now and then. Remove the tray from the oven and set it aside.
Place a large wok over medium heat. After about a minute, add the oil and swirl to coat the pan. Turn the heat to high and add the onion, carrots and ginger, if desired. Sprinkle with salt and stir-fry for about 5 minutes or until the carrot is beginning to become tender. (It's OK to taste!)
Toss in the garlic and red pepper pieces and continue to cook over high heat for another 5 minutes. Add the vinegar and soy sauce and cook for about 2 minutes longer.
Add red pepper flakes to taste, if desired, and serve hot or warm, topped with the cashews and garnished, if you wish, with pineapple.
Nutrition information per serving: