@nickgraffis/us-counties
v0.0.2
Published
Easily work with US Counties.
Downloads
8
Maintainers
Readme
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'
* }
* ]
*/