Skip to content

Parse address string into House no, street, city, state/region, country and zip code.

License

Notifications You must be signed in to change notification settings

MAXDeliveryNG/postaddress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postaddress

NPM

Build Status Requirements Status

Parse a human name string into salutation, first name, middle name, last name, suffix.

Install

npm install postaddress

Usage

var human = require('postaddress');

parse human name

var fullName = 'Mr. William R. Hearst, III';
	var attrs = human.parseName(fullName);

console.log(attrs);

//produces the following output

{ 
	saluation: 'Mr.',
	firstName: 'William',
	suffix: 'III',
	lastName: 'Hearst',
	middleName: 'R.',
	fullName: 'Mr. William R. Hearst, III'
}

get fullest name in string

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

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

parse address

var address = '123 Happy Street, Honolulu, HI  65780';
var 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'
}

About

Parse address string into House no, street, city, state/region, country and zip code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published