Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

states-us

justinlettau146.3kMIT1.1.1TypeScript support: included

List of US states and territories.

united states, usa, us, states, territories, array, abbreviation, abbreviations

readme

NPM Version CI codecov

US States

List of US states and territories.

Installation

npm install states-us --save

Usage

import states from 'states-us';

console.log(states);
// => all states and territories

const example1 = states.filter((x) => x.contiguous);
console.log(example1);
// => contiguous states only

const example2 = states.filter((x) => x.territory);
console.log(example2);
// => territories only

const example3 = states.map((x) => x.abbreviation);
console.log(example2);
// => all state/territory abbreviations

The default export from states-us is an array of State, with the following structure:

Property Type Description Example
name string State name. Alaska
abbreviation string State abbreviation. AK
territory boolean Indicates if the state is a territory. false
contiguous boolean Indicates if the state is contiguous. false

Development

npm install
npm run build

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.1.1 (2024-09-22)

Bug Fixes

1.1.0 (2024-09-22)

Features

1.0.4 (2023-11-18)

Bug Fixes

1.0.3 (2023-11-03)

Bug Fixes

  • remove Micronesia and Marshall Islands (#54) (fc3e604)

1.0.2 (2022-06-01)

1.0.1 (2020-11-28)