How to get the package name that I have installed

Hi,
How could i get the name, version of all packages that i have installed? And then ouput the result as a csv or xlsx file? Thanks for help.

installed.packages()

Thank you for your help, i get it.