How to achieve the equivalent of R's dput in Julia?

AFAIK dput prints code which can be used to “recreate” the object in R.

Julia has no equivalent functionality if you insist on a source code representation, but it has various ways of saving and recreating objects, including the Serialization standard library and the JLD2.jl package.