Tested on macOS Monterey (12.6.5) with Apple M1 Pro chip (ARM architecture)
diskutil list
hdiutil attach -nomount -nobrowse ram://120000 # 120000 * 512bytes = ~ 61.4 MB RAM disk
newfs_hfs /dev/disk* # <- * is number generated by previous command
# Aware: '/tmp/ramdisk' path MUST exist first
mount -t hfs -v /dev/disk* /tmp/ramdisk # <- * is number generated by previous command
umount /tmp/ramdisk
hdiutil detach /dev/disk* # <- * is number generated by previous command