<commit_before># node-countries
Countries JSON data

## Installation

Install via [npm](https://www.npmjs.com/):

```
$ npm install node-countries
```

## Documentation

This module currently has states and provinces for:

* united states (US)
* united kingdom (GB)
* canada (CA)
* mexico (MX)
* australia (AU)
* china (CN)
* germany (DE)
* belgium (BE)
* netherlands (NL)
* denmark (DK)
* Turkey (TR)
* Indonesia (ID)
* Jordan (JO)
* India (IN)
* Cambodia (KH)
* Ethiopia (ET)
* Peru (PE)
* Cuba (CU)
* Argentina (AR)
* Chile (CL)
* Bolivia (BO)
* Spain (ES)
* Bangladesh (BD)
* Pakistan (PK)
* Nigeria (NG)
* Japan (JP)
* austria (AT)
* brazil (BR)
* Philippines (PH)
* Vietnam (VN)

### Data

#### `JSON`

Return a JSON array with all the countries
```javascript
[
  {
    "alpha2": "AC",
    "alpha3": "",
    "countryCallingCodes": [
      "+247"
    ],
    "currencies": [
      "USD"
    ],
    "ioc": "SHP",
    "languages": [
      "eng"
    ],
    "name": "Ascension Island",
    "status": "reserved",
    "provinces": null
  },
  {
    "alpha2": "AD",
    "alpha3": "AND",
    "countryCallingCodes": [
      "+376"
    ],
    "currencies": [
      "EUR"
    ],
    "ioc": "AND",
    "languages": [
      "cat"
    ],
    "name": "Andorra",
    "status": "assigned",
    "provinces": null
  },
  ...
]
```

#### Short cut

All the contry are accessible directly through their [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) (two letter code)
```javascript
const countries = require('countries');

console.log(countries.AC);
/*
  {
    "alpha2": "AC",
    "alpha3": "",
    "countryCallingCodes": [
      "+247"
    ],
    "currencies": [
      "USD"
    ],
    "ioc": "SHP",
    "languages": [
      "eng"
    ],
    "name": "Ascension Island",
    "status": "reserved",
    "provinces": null
  }
*/
```
Also you have the possibility to find province information by name

##### getProvinceByName(name, [isCaseSensitive])

Return the matched province object, else undefined (alias: `findProvinceByName`)

##### getProvinceByNameAndAlias(englishName, [isCaseSensitive])

Return the matched province object, else undefined (alias: `findProvinceByNameAndAlias`)


## Methods

### getCountryByName(name, [isCaseSensitive])

Return the matched country object, else undefined (alias: `findCountryByName`)

## Examples

````javascript
const countries = require('countries');

console.log(countries.getCountryByName('Andorra'));
/*
  {
    "alpha2": "AD",
    "alpha3": "AND",
    "countryCallingCodes": [
      "+376"
    ],
    "currencies": [
      "EUR"
    ],
    "ioc": "AND",
    "languages": [
      "cat"
    ],
    "name": "Andorra",
    "status": "assigned",
    "provinces": null
  }
*/
````

## Note

Inspired by [country-data](https://github.com/OpenBookPrices/country-data) and [provinces](https://github.com/substack/provinces)

## Contributing

This project is a work in progress and subject to API changes, please feel free to contribute<commit_msg>feat(data) add countries and provinces alias<commit_after># node-countries
Countries JSON data

## Installation

Install via [npm](https://www.npmjs.com/):

```
$ npm install node-countries
```

## Documentation

This module currently has states and provinces for:

* united states (US)
* united kingdom (GB)
* canada (CA)
* mexico (MX)
* australia (AU)
* china (CN)
* germany (DE)
* belgium (BE)
* netherlands (NL)
* denmark (DK)
* Turkey (TR)
* Indonesia (ID)
* Jordan (JO)
* India (IN)
* Cambodia (KH)
* Ethiopia (ET)
* Peru (PE)
* Cuba (CU)
* Argentina (AR)
* Chile (CL)
* Bolivia (BO)
* Spain (ES)
* Bangladesh (BD)
* Pakistan (PK)
* Nigeria (NG)
* Japan (JP)
* austria (AT)
* brazil (BR)
* Philippines (PH)
* Vietnam (VN)

### Data

#### `JSON`

Return a JSON array with all the countries
```javascript
[
  {
    "alpha2": "AC",
    "alpha3": "",
    "countryCallingCodes": [
      "+247"
    ],
    "currencies": [
      "USD"
    ],
    "ioc": "SHP",
    "languages": [
      "eng"
    ],
    "name": "Ascension Island",
    "status": "reserved",
    "provinces": null,
    "alias": null
  },
  {
    "alpha2": "AD",
    "alpha3": "AND",
    "countryCallingCodes": [
      "+376"
    ],
    "currencies": [
      "EUR"
    ],
    "ioc": "AND",
    "languages": [
      "cat"
    ],
    "name": "Andorra",
    "status": "assigned",
    "provinces": null,
    "alias": null
  },
  ...
]
```

#### Short cut

All the contry are accessible directly through their [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) (two letter code)
```javascript
const countries = require('countries');

console.log(countries.AC);
/*
  {
    "alpha2": "AC",
    "alpha3": "",
    "countryCallingCodes": [
      "+247"
    ],
    "currencies": [
      "USD"
    ],
    "ioc": "SHP",
    "languages": [
      "eng"
    ],
    "name": "Ascension Island",
    "status": "reserved",
    "provinces": null,
    "alias": null
  }
*/
```
Also you have the possibility to find province information by name

##### getProvinceByName(name, [isCaseSensitive])

Return the matched province object, else undefined (alias: `findProvinceByName`)

##### getProvinceByNameAndAlias(englishName, [isCaseSensitive])

Return the matched province object, else undefined (alias: `findProvinceByNameAndAlias`)


## Methods

### getCountryByName(name, [isCaseSensitive])

Return the matched country object, else undefined (alias: `findCountryByName`)

## Examples

````javascript
const countries = require('countries');

console.log(countries.getCountryByName('Andorra'));
/*
  {
    "alpha2": "AD",
    "alpha3": "AND",
    "countryCallingCodes": [
      "+376"
    ],
    "currencies": [
      "EUR"
    ],
    "ioc": "AND",
    "languages": [
      "cat"
    ],
    "name": "Andorra",
    "status": "assigned",
    "provinces": null,
    "alias": null
  }
*/
````

## Note

Inspired by [country-data](https://github.com/OpenBookPrices/country-data) and [provinces](https://github.com/substack/provinces)

## Contributing

This project is a work in progress and subject to API changes, please feel free to contribute
{'fraction_non_alphanumeric': 0.17649975210708974, 'fraction_numerical': 0.00925466864980995, 'mean_word_length': 3.244039270687237, 'pattern_counts': {'":': 76, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6730400', 'n_tokens_mistral': 2200, 'n_tokens_neox': 2128, 'n_words': 534}