expression, noun
close call; narrow escape; by a hair's breadth
Describes a situation where something bad was barely avoided, often with a sense of relief. Commonly used with で or as an adverbial phrase.
間一髪のところで電車に間に合った。
I barely caught the train.
事故に遭いそうになったが、間一髪のところで助かった。
I almost had an accident, but I was saved by a hair's breadth.
From 間 (kan, 'interval') + 一髪 (ippatsu, 'one hair'), literally 'by the width of a single hair'. The phrase のところ ('at the point of') turns it into a noun-like expression meaning 'a situation where the margin is as thin as a hair'.