Version: 1.0.6

API Quick Reference

Quick Peek

MethodsArgumentsDefaultReturnsDescription
getPrefixnonenonestringGets the prefix part of the full name, if any
getFirstnamenonenonestringGets the first name part of the full name
getMiddlenamesnonenonestring[]Gets the middle name part of the full name
getLastnamenonenonestringGets the last name part of the full name
getSuffixnonenonestringGets the suffix part of the full name, if any
getFullnameorderedBynullstringGets the full name
getInitialsorderedBy, withMidnull, falsestringGets the initials of the first and last name
describewhatfullnamestringGives some descriptive statistics that summarize the central tendency, dispersion and shape of the characters' distribution.
shortenorderedBynullstringReturns a typical name (e.g. first and last name)
compresslimit, by20, middlenamestringCompresses a name by using different forms of variants
usernamenonenonestring[]Suggests possible (randomly) usernames closest to the name
formathow: stringnullstringFormats the name as desired

Aliases

Some methods are also accessible via aliases:

MethodsAliases
getPrefixpx
getSuffixsx
getFirstnamefn
getLastnameln
getMiddlenamesmn
getFullnamefull
getInitialsinits
describestats

Example:

import { Namefully } from 'namefully'
const name = new Namefully('Angela Merkel')
// Retrieve the last name part
console.log(name.getLastname()) // => Merkel
// or using an alias
console.log(name.ln()) // => Merkel