0.0.3 • Published 2 years ago

transmute-state v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Transmute State Names

By Chris Wilson

v.0.0.2

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.

Properties returned

  • Official name (name)
  • Two-letter abbreviation (usps)
  • Two-digit FIPS code (fips)
  • Associated Press style (ap)
  • Chicago Manual of Style style (chicago)
  • Boolean flag on whether this is a state (is_state)

Coverage

The 50 states, Washington, D.C., American Samoa, Guam, Northern Mariana Islands, Puerto Rico, U.S. Minor Outlying Islands and U.S. Virgin Islands

Installation

npm install transmute-state --save

Usage

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

Lookups

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.

Sources

License

MIT

To Do

  • Fuzzy matching
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago