The use of tapered optical fibers, i.e., optical nanofibers, for spectroscopy and the detection of small numbers of particles, such as neutral atoms or molecules, has been gaining interest in recent years. In this review, we briefly introduce the optical nanofiber, its fabrication, and optical mode propagation within. We discuss recent progress on the integration of optical nanofibers into laser-cooled atom and vapor systems, paying particular attention to spectroscopy, cold atom cloud characterization, and optical trapping schemes. Next, a natural extension of this work to molecules is introduced. Finally, we consider several alternatives to optical nanofibers that display some advantages for specific applications.