1.1.2 • Published 6 years ago

us-state-codes v1.1.2

Weekly downloads
11,139
License
MIT
Repository
github
Last release
6 years ago

us-state-codes

Circle CI

A library to help you search, validate, and convert between US state names and state codes.

Installation

npm install us-state-codes --save

Usage

var states = require('us-state-codes');

var stateCode = 'HI.';
var stateName = '(HawAiI) ';

assert(states.sanitizeStateCode(stateCode) === 'HI');
assert(states.sanitizeStateName(stateName) === 'Hawaii');

assert(states.getStateNameByStateCode(stateCode) === 'Hawaii');
assert(states.getStateCodeByStateName(stateName) === 'HI');

License

MIT.