Version: 1.2.0

API Quick Reference

Quick Peek

Properties

PropertiesTypeModifierDescription
configConfigread-onlyThe current configuration.
lengthnumberread-onlyThe number of characters of the birth name, including spaces.
prefixstring?read-onlyThe prefix part.
firststringread-onlyThe first name.
middlestring?read-onlyThe first middle name if any.
laststringread-onlyThe last name.
suffixstring?read-onlyThe suffix part.
hasMiddlebooleanread-onlyReturns true if any middle name has been set.
birthstringread-onlyThe birth name.
shortstringread-onlyThe shortest version of a person name.
longstringread-onlyThe longest version of a person name.
publicstringread-onlyThe first name combined with the last name's initial.
fullstringread-onlyThe entire name set.

Methods

MethodsReturnsDescription
toString()stringReturns the full name as set.
get(Namon)Name?/Name[]Fetches the raw form of a name piece.
equal(Namefully)booleanReturns the full name as set.
toJson()JsonNameReturns the full name as set.
has(Namon)booleanReturns the full name as set.
fullName(NameOrder?)stringGets the full name ordered as configured.
birthName(NameOrder?)stringGets the birth name ordered as configured, no prefix or suffix.
firstName(boolean?)stringGets the first name part of the full name.
middleName()string[]Gets the middle name part of the full name.
lastName(Surname?)stringGets the last name part of the full name.
initials()string[]Gets the initials of the full name.
shorten(NameOrder?)stringReturns a combination of first and last name.
flatten(object?)stringFlattens a long name using the name types as variants.
zip(Flat?, boolean?)stringZips or compacts a name using different forms of variants.
format(string)stringFormats the full name as desired.
flip()voidFlips definitely the name order from the current config.
split(RegExp)string[]Splits the name parts of a birth name.
join(string)stringJoins the name parts of a birth name.
toUpperCase()stringTransforms a birth name into UPPERCASE.
toLowerCase()stringTransforms a birth name into lowercase.
toCamelCase()stringTransforms a birth name into camelCase.
toPascalCase()stringTransforms a birth name into PascalCase.
toHyphenCase()stringTransforms a birth name into hyphen-case.
toDotCase()stringTransforms a birth name into dot.case.
toSnakeCase()stringTransforms a birth name into snake_case.
toToggleCase()stringTransforms a birth name into ToGgLeCaSe.

Static Methods

MethodsReturnsDescription
tryParse(string)NamefullyConstructs an instance from a text.
parse(string)Promise<Namefully>Constructs asynchronously an instance from a text.

Back to Top