@braweria/full-name-parser

1.0.3 • Public • Published

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

MIT

Author

Contribution

You want to help out and make this library better? Feel free to open a PR!

Check out some of the issues.


ko-fi

Package Sidebar

Install

npm i @braweria/full-name-parser

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

19.6 kB

Total Files

21

Last publish

Collaborators

  • braweria