As with Ether and Nephi, the son of Helaman, an event in the life of Nephi (the first one--the son of Lehi) bears particular resemblance to one in the Savior's, making Nephi a "type" of Christ.
Because of threats against Lehi, Nephi's father, for his prophesying of the Messiah (see 1 Nephi 1:18-20), the Lord warned Lehi in dream to take his family and leave their home in Jerusalem:
For behold, it came to pass that the Lord spake unto my father, yea, even in a dream, and said unto him: Blessed art thou Lehi, because of the things which thou hast done; and because thou hast been faithful and declared unto this people the things which I commanded thee, behold, they seek to take away thy life.
And it came to pass that the Lord commanded my father, even in a dream, that he should take his family and depart into the wilderness.
And it came to pass that he was obedient unto the word of the Lord, wherefore he did as the Lord commanded him. (1 Nephi 2:1-3)
Similarly, because Herod was "troubled" by prophecies regarding the King of the Jews (see Matthew 2:1-3), Jesus' guardian, Joseph, was warned in a dream to flee with his family from Bethlehem--not far away from Jerusalem--in order to protect the life of his sacred charge:
...Behold, the angel of the Lord appeareth to Joseph in a dream, saying, Arise, and take the young child and his mother, and flee into Egypt, and be thou there until I bring thee word: for Herod will seek the young child to destroy him.
When he arose, he took the young child and his mother by night, and departed into Egypt:
And was there until the death of Herod... (Matthew 2:13-15)
Horrible tragedies then befell the peoples each family had left behind:
Wherefore, it hath been told [the Jews] concerning the destruction which should come upon them, immediately after [Lehi] left Jerusalem; nevertheless, they hardened their hearts; and... they have been destroyed, save it be those which are carried away captive into Babylon. (2 Nephi 25:9)
Then Herod, when he saw that he was mocked of the wise men, was exceeding wroth, and sent forth, and slew all the children that were in Bethlehem, and in all the coasts thereof, from two years old and under, according to the time which he had diligently enquired of the wise men.
Then was fulfilled that which was spoken by Jeremy the prophet [or Jeremiah, Lehi's contemporary, interestingly enough], saying,
In Rama was there a voice heard, lamentation, and weeping, and great mourning, Rachel weeping for her children, and would not be comforted, because they are not. (Matthew 2:16-18)