Transmute State Names
By Chris Wilson
This is a simple repo that takes any common name or code for a state or territory and returns an object with all common identifiers. No dependencies.
- Official name (
- Two-letter abbreviation (
- Two-digit FIPS code (
- Associated Press style (
- Chicago Manual of Style style (
- Boolean flag on whether this is a state (
The 50 states, Washington, D.C., American Samoa, Guam, Northern Mariana Islands, Puerto Rico, U.S. Minor Outlying Islands and U.S. Virgin Islands
npm install transmute-state --save
const transmute = require('transmute-state'); const DC = transmute("DC"); console.log(DC.name, DC.fips, DC.ap, DC.is_state); // District of Columbia 11 D.C. false
All lookups are santizied to keys without punctuation or capitalization, so "Conn." and "conn" with both return codes for Connecticut. There is not currently any fuzzy matching for common misspellings or identifiers like 'Washington, D.C.' that don't appear in the results.
- American National Standards Institute (ANSI) Codes for States, the District of Columbia, Puerto Rico, and the Insular Areas of the United States
- United States Postal Service: State Abbreviations
- State Abbreviations: Use Traditional or Go Postal?
- Fuzzy matching