Version 2.x of the excellent date package date-fns only has these built-in am/pm formats.
date-fns
How can I format the lower case am/pm without the periods?
You can now use the aaa pattern for that case (v.2.23.0).
aaa
(v.2.23.0)
Source: https://date-fns.org/v2.23.0/docs/format