light-weight-countries-list
Version:
A simple list of all countries
29 lines (19 loc) • 680 B
Markdown
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";`
```js
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);
```