Is 外地人 a derogatory word? My Shanghainese friend frequently says 外地人 in slightly negative/hostile context. I understand the meaning of 外地人, which is people from different city/province.

However, is it a derogatory term? Or is it just a normal word in and of itself but sometimes used negatively depending on context (this is true in Japanese word).

And is it rude to say 外地人 to people from rural living in developed city (especially Shanghai but also Hangzhou, Beijing, etc...)? I only talk with 1980s and 1990s, FYI. And if it is not rude, is there any such word that is considered derogatory?
Like what they said, 外地人 is a neutral word. But I think the meaning has changed, especially in Beijing, Shanghai, Guangzhou where the economic level is higher than other cities. The natives whose father or grandfather or great-grandfather lived there don't like people from other place. So if you are from other place, and you talk with someone who are from other places too, it is ok to say the word. But if you are from Shanghai, but the one you are talking to is not, it is better for you not to say the word.