# states-us

> List of US states and territories.

Latest version **1.1.1** (published 2024-09-22) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install states-us
pnpm add states-us
yarn add states-us
bun add states-us
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2024-09-22 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 22.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Justin Lettau |
| Maintainers | justinlettau |
| Keywords | united states, usa, us, states, territories, array, abbreviation, abbreviations |

## Links

- npm: https://www.npmjs.com/package/states-us
- Repository: https://github.com/justinlettau/states-us
- Issues: https://github.com/justinlettau/states-us/issues
- npm.io page: https://npm.io/package/states-us

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2024-09-22
- 1.1.0 — 2024-09-22
- 1.0.4 — 2023-11-18
- 1.0.3 — 2023-11-03
- 1.0.2 — 2022-06-01
- 1.0.1 — 2020-11-28
- 1.0.0 — 2020-01-16

## README

[![NPM Version](https://badge.fury.io/js/states-us.svg)](https://badge.fury.io/js/states-us)
[![CI](https://github.com/justinlettau/states-us/workflows/CI/badge.svg)](https://github.com/justinlettau/states-us/actions)
[![codecov](https://codecov.io/gh/justinlettau/states-us/branch/master/graph/badge.svg)](https://codecov.io/gh/justinlettau/states-us)

# US States

List of US states and territories.

# Installation

```bash
npm install states-us --save
```

# Usage

```js
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
```

---
_Source: https://npm.io/package/states-us · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
