First it was in oral form spoken to Adam, Noah, Abraham, etc. Second, it was written down by Moses and then other prophets as God gave His words to them.
29 Du sot den Abraham: ’Si hunn de Moses an d’Prophéiten; op déi sollen si lauschteren!’