Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunny-unik/eu-country-check
This project help to check provided country code belongs from European countries or not.
https://github.com/sunny-unik/eu-country-check
beginner-friendly initiatives npm-package npmjs open-source typescript
Last synced: about 1 month ago
JSON representation
This project help to check provided country code belongs from European countries or not.
- Host: GitHub
- URL: https://github.com/sunny-unik/eu-country-check
- Owner: Sunny-unik
- License: mit
- Created: 2022-08-13T18:11:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-14T12:28:20.000Z (about 1 year ago)
- Last Synced: 2024-12-12T16:07:32.808Z (2 months ago)
- Topics: beginner-friendly, initiatives, npm-package, npmjs, open-source, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/eu-country-check
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/Contributing.md
- License: LICENSE
- Code of conduct: docs/code-of-conduct.md
Awesome Lists containing this project
README
# eu-country-check> This package is to check if the given country-code/country-name is part of the EU (European Union) or EEA (European Economic Area).
[](https://github.com/Sunny-unik/eu-country-check)
[](https://github.com/Sunny-unik/eu-country-check/actions/workflows/publish-on-npmjs.yml)# Installation
```bash
npm i eu-country-check
```or
```bash
yarn add eu-country-check
```Then...
```typescript
import { isEUCountry, isEEACountry } from "eu-country-check";console.log(isEUCountry("040")); // { name: 'Austria', alpha2: 'AT', alpha3: 'AUT', numeric: '040' }
console.log(isEEACountry("NO")); // { name: 'Norway', alpha2: 'NO', alpha3: 'NOR', numeric: '578' }
console.log(isEUCountry("NO")); // undefined
console.log(isEEACountry("CA")); // undefined
```## Functions
**eu-country-check** contains 2 functions:
- `isEUCountry(countryCode: string)`
- `isEEACountry(countryCode: string)`~ "_countryCode_" is required parameter that could be name, alpha2, alpha3 or numeric code.
## ⚖️ LICENSE
MIT © [Sunny-unik/eu-country-check](LICENSE)