@nickgraffis/us-counties
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

US Counties

Work easily with US Counties from a dataset of all US Counties by FIPS, Name, and StateCode.

All data is from USDA Natural Resources Conservation Service.

Installation

npm i @nickgraffis/us-counties

Or use yarn or pnpm.

Useage

Get County By Name - Includes

import { getCountyByNameIncludes } from "@nickgraffis/us-counties"

getCountyByNameIncludes('Los')
/*
* [
*   {
*     name: 'Los Angeles',
*     FIPS: '64723',
*     state: 'CA'
*   }
* ]
*/

Get County By Name - Starts With

import { getCountyByNameStartsWith } from "@nickgraffis/us-counties"

getCountyByNameStartsWith('Los')
/*
* [
*   {
*     name: 'Los Angeles',
*     FIPS: '64723',
*     state: 'CA'
*   }
* ]
*/

Get County By FISP

import { getCountyByFips } from "@nickgraffis/us-counties"

getCountyByFips('64723')
/*
* {
*   name: 'Los Angeles',
*   FIPS: '64723',
*   state: 'CA'
* }
*/

Get County By State

import { getCountyByState } from "@nickgraffis/us-counties"

getCountyByState('CA')
/*
* [
*   {
*     name: 'Los Angeles',
*     FIPS: '64723',
*     state: 'CA'
*   }
* ]
*/

Package Sidebar

Install

npm i @nickgraffis/us-counties

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

651 kB

Total Files

6

Last publish

Collaborators

  • nickgraffis