Melt butter in a frypan over medium heat. Add onions, and cook slowly until the onions have softened and turned deep brown, about 15 minutes. Warm the cream cheese over low heat in a small frypan until very soft.
Grill hot dogs until well browned. Lightly grill hot dog buns on both sides.
To assemble, spread warm cream cheese on toasted hot dog bun, add hot dog or sausage, top with onions, mustard and sauerkraut, if desired.