D'Addario is known for its high-quality strings and packaging, as almost all its strings come in some form of air-tight packets. Some are marked with Corrosion Intercept Technology, while others just plainly as corrosion resistance packaging. Whatever the case, you can expect to get some of the longest shelf life out of D'Addario's guitar strings. Their strings virtually never go bad or corrode in packaging; at least, I've never heard or seen one come rusty out of the package, even after decades.
You can easily expect D'Addario strings to stay fresh in their unopened package for 3-5 years or even longer.