Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ralyodio/humanparser
Parse a human name string into salutation, first name, middle name, last name, suffix.
https://github.com/ralyodio/humanparser
data es6 javascript parsing scraping
Last synced: 11 days ago
JSON representation
Parse a human name string into salutation, first name, middle name, last name, suffix.
- Host: GitHub
- URL: https://github.com/ralyodio/humanparser
- Owner: ralyodio
- License: mit
- Created: 2014-05-26T05:50:57.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T13:47:49.000Z (6 months ago)
- Last Synced: 2024-12-12T22:13:20.102Z (13 days ago)
- Topics: data, es6, javascript, parsing, scraping
- Language: JavaScript
- Homepage: https://www.npmjs.org/package/humanparser
- Size: 124 KB
- Stars: 97
- Watchers: 6
- Forks: 32
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
humanparser
=========[![NPM](https://nodei.co/npm/humanparser.png)](https://nodei.co/npm/humanparser/)
Parse a human name string into salutation, first name, middle name, last name, suffix.
## Install
npm install humanparser
## Usage
const human = require('humanparser');
### parse human nameconst fullName = 'Mr. William R. Hearst, III';
const attrs = human.parseName(fullName);console.log(attrs);
//produces the following output
{
salutation: 'Mr.',
firstName: 'William',
suffix: 'III',
lastName: 'Hearst',
middleName: 'R.',
fullName: 'Mr. William R. Hearst, III'
}
### get fullest name in stringconst name = 'John & Peggy Sue';
const fullName = human.getFullestName(name);//produces the following output
{
fullName: 'Peggy Sue'
}
### parse addressconst address = '123 Happy Street, Honolulu, HI 65780';
const parsed = human.parseAddress(address);
//produces the following output
{
address: '123 Happy Street',
city: 'Honolulu',
state: 'HI',
zip: '65780',
fullAddress: '123 Happy Street, Honolulu, HI 65780'
}