If you complete something by the skin of your teeth, you only just succeed in doing it. This idiom is usually heard in regard to a narrow escape from something going terribly wrong, or from the threat of danger or harm. This idiom is also commonly heard in both social and professional environments.
He landed the jump by the skin of his teeth.
She made the meeting by the skin of her teeth after she was stuck in traffic.