us-state-codes

1.1.2 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i us-state-codes

Weekly Downloads

14,958

Version

1.1.2

License

MIT

Unpacked Size

6.11 kB

Total Files

6

Last publish

Collaborators

  • mdzhang