Dollar General is bucking the retail trend.

The discount chain announced Thursday that it plans to open 900 new stores in 2018 for the second year in a row. Dollar General did not say how many new jobs the openings could create.

"Our first priority remains investing in new stores where we continue to see great returns," said CFO John Garratt on a call with investors.

Dollar General has become a shopping staple across the country. It currently has more than 14,000 stores in 44 states, a 35% increase from five years ago.

By the end of the year, more than three in four Americans will live within 5 miles of a Dollar General, the company noted on the call.

Dollar stores are one of the few retail groups that are thriving. Many traditional brick-and-mortar retailers have been eclipsed by the growth of e-commerce.

Shares of Dollar General (DG) have climbed 25% this year. Dollar Tree (DLTR), its top discount competitor, has risen 38%.

Dollar General has succeeded thanks to its lean business model, said GlobalData Retail analyst Neil Saunders. Its smaller stores sell cheap day-to-day essentials, especially in rural areas where it doesn't make sense for Walmart or other large retailers to open up shop.

"The company [is] the closest and most convenient general merchant for millions," said Saunders.

Sales were up 4.3% last quarter at stores that were open a year ago, a sign of retail health. Revenue last quarter ballooned to $5.9 billion -- an 11% uptick from last year -- in part from hurricane-related spending in Texas and Florida.

More middle income and affluent shoppers are helping lift Dollar General's overall sales. The expansion, especially in metro areas, will allow it to continue reaching these shoppers, said Saunders.

Market Sectors: See latest news & which stock market segments are performing best

But lower-income Americans remain the store's primary customers. The stores attracted shoppers during the economic downturn in 2008 and 2009, and consumers haven't stopped coming back since, even as the economy has picked up steam.

Analysts expect Dollar General's run to continue as long as government benefits to support poorer Americans, like Medicaid and food stamps, remain steady.

"A reduction in social benefits, like food stamps, and an increase in healthcare or housing costs may continue to be a headwind for Dollar General's customers," said Morningstar's John Brick.