Full Name Parse
This is a simple name parser, that will chop a name into its components of prefix, first, middle, initials, infix, last and suffix. If something doesn't exist, it will be returned as null
.
Installation
With Yarn
yarn add @braweria/full-name-parser
With NPM
npm i @braweria/full-name-parser
Usage
To use this library, just import parseName
into your file, and immediatelly start using it!
import { parseName } from "full-name-parser";
const parsedName = parseName("Prof. Steph Alice von Wolfenstein, III");
console.log(parsedName);
{
"prefix": "Prof.",
"first": "Steph",
"middle": "Alice",
"initials": null,
"infix": "von",
"last": "Wolfenstein",
"suffix": "III",
"full": "Prof. Steph Alice von Wolfenstein"
}
Tests
yarn test
or
npm run test
License
Author
- Wiktoria "Braweria" Mielcarek
- GitHub: https://github.com/Braweria
- Twitter: https://twitter.com/braweria
- LinkedIn: https://www.linkedin.com/in/wiktoria-mielcarek/
Contribution
You want to help out and make this library better? Feel free to open a PR!