# humanparser

> Parse a human name string into salutation, first name, middle name, last name, suffix. Parse an address into address, city, state, zip

Latest version **2.7.0** (published 2023-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install humanparser
pnpm add humanparser
yarn add humanparser
bun add humanparser
```

## Health

**Score 38/100 (D)** — status: abandoned.

Positive: has types package; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.7.0 |
| Published | 2023-05-20 |
| First published | 2014-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/humanparser) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 106 |
| Author | Anthony Ettinger |
| Maintainers | chovy |
| Keywords | human, address, name, parser, parse, fullname, full name, first name, last name, human name, city state zip, city, state, zip |

## Links

- npm: https://www.npmjs.com/package/humanparser
- Repository: https://github.com/chovy/humanparser
- Homepage: https://github.com/chovy/humanparser#readme
- Issues: https://github.com/chovy/humanparser/issues
- npm.io page: https://npm.io/package/humanparser

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.7.0 (latest) — 2023-05-20
- 2.6.0 — 2020-09-02
- 2.5.0 — 2020-09-02
- 2.4.0 — 2020-09-02
- 2.3.0 — 2020-09-02
- 2.2.0 — 2020-09-02
- 2.1.0 — 2020-09-02
- 2.0.2 — 2020-09-01
- 2.0.1 — 2020-09-01
- 2.0.0 — 2020-09-01
- 1.11.0 — 2019-07-09
- 1.10.0 — 2018-10-24
- 1.9.0 — 2018-09-25
- 1.8.2 — 2018-09-20
- 1.8.0 — 2018-09-20
- … 24 more at https://npm.io/package/humanparser/versions

## 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 name    

    const 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 string

    const name = 'John & Peggy Sue';
    const fullName = human.getFullestName(name);

    //produces the following output
    {
        fullName: 'Peggy Sue'
    }
      
### parse address

    const 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'
    }

---
_Source: https://npm.io/package/humanparser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
