get user role value as a string from wp usermeta table into custom script

get user role value as a string from wp usermeta table into custom script