Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

US Regions

Lists of states and territories in the US and Canada, and mappings to regions. Data sources:

Installation

In node:

npm install us-regions

For the browser:

bower install us-regions

Usage

In node, require it:

var regions = require("us-regions");

In the browser, the global USRegions is available.

  • regions.postalAbbr(name): Returns a postal abbreviation (e.g. "CA", "MT", "MA") for the given state or territory name or abbreviation (e.g. "calif", "Montana", "Mass."), or undefined if not found.
  • regions.normalize(name): Returns a normalized full name ("District of Columbia", "Newfoundland and Labrador", "Wyoming") for the given state or territory name or abbreviation ("DC", "Newfoundland", "wyo"), or undefined if not found.
  • regions.region(name): Returns a US geographic region for the given state or territory name or abbreviation. Regions: "Northeast", "Midwest", "South", "West".

Also includes several mappings for raw usage -- consult index.js for details:

  • regions.US_STATES_AND_TERRITORIES
  • regions.FIFTY_STATES
  • regions.CANADIAN_TERRITORIES
  • regions.US_AND_CANADA
  • regions.STATES_NORMALIZED
  • regions.US_REGIONS
  • regions.US_REGIONS_BY_STATE

Data sources:

About

Lists of US and Canadian states and territories, and regional categories

Resources

Stars

2 stars

Watchers

23 watching

Forks

Releases

Packages

Used by

Contributors

Languages