The invention provides compounds that modiste the activity of Janus kinases and are useful in the treatment of diseases related to activity of Janus kinases including, for example, immune-related diseases, skin disorders, myeloid proliferative disorders, cancer, and other diseases.