Fetching details from the dictionary...
barely; narrowly
almost; nearly
危うく電車に乗り遅れるところだった。
I barely made the train.
危うく転倒したが、壁に手をついて踏みとどまった。
I almost fell, but caught myself by putting my hand on the wall.
急ブレーキをかけて危うく事故を回避した。
I hit the brakes hard and narrowly avoided an accident.