The package is nice and simple, need a list of countries, you can find them here. Lightweight, deliberately simple in-order to reduce package size.
npm i light-weight-countries-list
import countries from "light-weight-countries-list";
import countries from "light-weight-countries-list";
// Get all countries
console.log(countries);
// Filter countries
const europeCountries = countries.filter((country) =>
["FR", "DE", "IT", "ES"].includes(country.code)
);
// Find a specific country
const findCountry = (code) =>
countries.find((country) => country.code === code);