Fetching details from the dictionary...
just before; on the verge of; on the brink of
just in front of; just ahead of
出発の寸前に電話が来た。
A call came just before departure.
事故の寸前で車を止めた。
I stopped the car just before an accident.
締め切り寸前になってようやく原稿が完成した。
The manuscript was finally completed just before the deadline.