strutils.toBin
Here's the documentation of Nim's standard library, you can find everything using the search bar:
https://nim-lang.org/docs/lib.html