County is a simple JavaScript library that provides functionality for working with state-wise county names in the United States.
You can install the County Library via npm:
npm install county
const countyLibrary = require("county");
const states = countyLibrary.getAllStates();
console.log(states);
// Output: ["Alabama", "Alaska", /* Other states */]
const counties = countyLibrary.getCountiesByState("Alabama");
console.log(counties);
// Output: ["Autauga", "Baldwin", "Barbour", /* Other counties in Alabama */]
const matchingCounties = countyLibrary.searchCounties("lake");
console.log(matchingCounties);
// Output: ["Lake", "Lake and Peninsula", /* Other matching counties */]
- This project is licensed under the MIT License - see the LICENSE file for details.