nearly; almost; on the point of (doing something, usually a negative or dangerous outcome nearly occurred).
電車に危なく乗り遅れるところだった。
I nearly missed the train.
危なく道で転ぶところだったが、友達が支えてくれた。
I almost fell in the street, but a friend caught me.
危なく火事になるところだったので、早く気付いてよかった。
It was almost a fire, so it's good we noticed early.