JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q65841F
  • License MIT

US state by index, by name and by abbreviation

Package Exports

  • ustates

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ustates) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#ustates

Build Status NPM version

Mapping US state codes by index, name or abbreviation.

Installation

$ npm install ustates

Usage

var states = require('ustates');

// by abbreviation:
console.log(states['GA']); //-> {"index":10,"name":"Georgia","code":"GA"}

// by index
console.log(states.index[45]); //-> {"index":45,"name":"Vermont","code":"VT"}

// by name
console.log(states.name['District Of Columbia']); //-> {"index":8,"name":"District Of Columbia","code":"DC"}

// by lower case name
console.log(states.name['DISTRICT OF COLUMBIA']); //-> {"index":8,"name":"District Of Columbia","code":"DC"}

// by upper case name
console.log(states.name['district of columbia']); //-> {"index":8,"name":"District Of Columbia","code":"DC"}

See Also

  • iso-3166-2 addresses the same problem space, but works for all countries in the world. See the docs there for the API differences.

License

(The MIT License)

Copyright (c) 2014 Jonathan Brumley <cayasso@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY