Compound words are formed by combining two or more words, such as "sunrise," "fireplace," or "high school." While "nearby" is formed from the words "near" and "by," it functions as a single, indivisible word with a distinct meaning.
Therefore, "nearby" is a single word, not a compound word.