COPY TO can output data as JSON, including as a single JSON array using the FORCE_ARRAY option.
COPY TO
FORCE_ARRAY