ROCHESTER, N.H. — The young women, soon to be mothers, gathered around a big kitchen table, chatting excitedly about due dates and baby names and even morning sickness.

But these were not typical expectant mothers. They had used opioids, mostly heroin and fentanyl. Many had been incarcerated. Few had families they could turn to for help, and the fathers of their babies were out of the picture.

Most of these women — tough, sassy, vulnerable — were destined to go through their pregnancies in a shelter, jail or even on the street, fending for themselves as they had often done before.

Instead, here they were last week, in the cozy kitchen of a classic 1856 New England farmhouse where the aroma of fresh-baked cornbread filled the air. Set before them was a comfort lunch of tomato soup and grilled cheese sandwiches.