converts javascript object to yaml-readable string