Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

country-region-data

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-region-data - npm Package Compare versions

Comparing version 2.0.0-beta.3 to 2.0.0

.nvmrc

498

dist/data.d.ts

@@ -21,251 +21,251 @@ declare module 'country-region-data' {

export const AF: CountryData;
export const AX: CountryData;
export const AL: CountryData;
export const DZ: CountryData;
export const AS: CountryData;
export const AD: CountryData;
export const AO: CountryData;
export const AI: CountryData;
export const AQ: CountryData;
export const AG: CountryData;
export const AR: CountryData;
export const AM: CountryData;
export const AW: CountryData;
export const AU: CountryData;
export const AT: CountryData;
export const AZ: CountryData;
export const BS: CountryData;
export const BH: CountryData;
export const BD: CountryData;
export const BB: CountryData;
export const BY: CountryData;
export const BE: CountryData;
export const BZ: CountryData;
export const BJ: CountryData;
export const BM: CountryData;
export const BT: CountryData;
export const BO: CountryData;
export const BQ: CountryData;
export const BA: CountryData;
export const BW: CountryData;
export const BV: CountryData;
export const BR: CountryData;
export const IO: CountryData;
export const BN: CountryData;
export const BG: CountryData;
export const BF: CountryData;
export const BI: CountryData;
export const KH: CountryData;
export const CM: CountryData;
export const CA: CountryData;
export const CV: CountryData;
export const KY: CountryData;
export const CF: CountryData;
export const TD: CountryData;
export const CL: CountryData;
export const CN: CountryData;
export const CX: CountryData;
export const CC: CountryData;
export const CO: CountryData;
export const KM: CountryData;
export const CG: CountryData;
export const CD: CountryData;
export const CK: CountryData;
export const CR: CountryData;
export const CI: CountryData;
export const HR: CountryData;
export const CU: CountryData;
export const CW: CountryData;
export const CY: CountryData;
export const CZ: CountryData;
export const DK: CountryData;
export const DJ: CountryData;
export const DM: CountryData;
export const DO: CountryData;
export const EC: CountryData;
export const EG: CountryData;
export const SV: CountryData;
export const GQ: CountryData;
export const ER: CountryData;
export const EE: CountryData;
export const ET: CountryData;
export const FK: CountryData;
export const FO: CountryData;
export const FJ: CountryData;
export const FI: CountryData;
export const FR: CountryData;
export const GF: CountryData;
export const PF: CountryData;
export const TF: CountryData;
export const GA: CountryData;
export const GM: CountryData;
export const GE: CountryData;
export const DE: CountryData;
export const GH: CountryData;
export const GI: CountryData;
export const GR: CountryData;
export const GL: CountryData;
export const GD: CountryData;
export const GP: CountryData;
export const GU: CountryData;
export const GT: CountryData;
export const GG: CountryData;
export const GN: CountryData;
export const GW: CountryData;
export const GY: CountryData;
export const HT: CountryData;
export const HM: CountryData;
export const VA: CountryData;
export const HN: CountryData;
export const HK: CountryData;
export const HU: CountryData;
export const IS: CountryData;
export const IN: CountryData;
export const ID: CountryData;
export const IR: CountryData;
export const IQ: CountryData;
export const IE: CountryData;
export const IM: CountryData;
export const IL: CountryData;
export const IT: CountryData;
export const JM: CountryData;
export const JP: CountryData;
export const JE: CountryData;
export const JO: CountryData;
export const KZ: CountryData;
export const KE: CountryData;
export const KI: CountryData;
export const KP: CountryData;
export const KR: CountryData;
export const XK: CountryData;
export const KW: CountryData;
export const KG: CountryData;
export const LA: CountryData;
export const LV: CountryData;
export const LB: CountryData;
export const LS: CountryData;
export const LR: CountryData;
export const LY: CountryData;
export const LI: CountryData;
export const LT: CountryData;
export const LU: CountryData;
export const MO: CountryData;
export const MK: CountryData;
export const MG: CountryData;
export const MW: CountryData;
export const MY: CountryData;
export const MV: CountryData;
export const ML: CountryData;
export const MT: CountryData;
export const MH: CountryData;
export const MQ: CountryData;
export const MR: CountryData;
export const MU: CountryData;
export const YT: CountryData;
export const MX: CountryData;
export const FM: CountryData;
export const MD: CountryData;
export const MC: CountryData;
export const MN: CountryData;
export const ME: CountryData;
export const MS: CountryData;
export const MA: CountryData;
export const MZ: CountryData;
export const MM: CountryData;
export const NA: CountryData;
export const NR: CountryData;
export const NP: CountryData;
export const NL: CountryData;
export const NC: CountryData;
export const NZ: CountryData;
export const NI: CountryData;
export const NE: CountryData;
export const NG: CountryData;
export const NU: CountryData;
export const NF: CountryData;
export const MP: CountryData;
export const NO: CountryData;
export const OM: CountryData;
export const PK: CountryData;
export const PW: CountryData;
export const PS: CountryData;
export const PA: CountryData;
export const PG: CountryData;
export const PY: CountryData;
export const PE: CountryData;
export const PH: CountryData;
export const PN: CountryData;
export const PL: CountryData;
export const PT: CountryData;
export const PR: CountryData;
export const QA: CountryData;
export const RE: CountryData;
export const RO: CountryData;
export const RU: CountryData;
export const RW: CountryData;
export const BL: CountryData;
export const SH: CountryData;
export const KN: CountryData;
export const LC: CountryData;
export const MF: CountryData;
export const PM: CountryData;
export const VC: CountryData;
export const WS: CountryData;
export const SM: CountryData;
export const ST: CountryData;
export const SA: CountryData;
export const SN: CountryData;
export const RS: CountryData;
export const SC: CountryData;
export const SL: CountryData;
export const SG: CountryData;
export const SX: CountryData;
export const SK: CountryData;
export const SI: CountryData;
export const SB: CountryData;
export const SO: CountryData;
export const ZA: CountryData;
export const GS: CountryData;
export const SS: CountryData;
export const ES: CountryData;
export const LK: CountryData;
export const SD: CountryData;
export const SR: CountryData;
export const SZ: CountryData;
export const SE: CountryData;
export const CH: CountryData;
export const SY: CountryData;
export const TW: CountryData;
export const TJ: CountryData;
export const TZ: CountryData;
export const TH: CountryData;
export const TL: CountryData;
export const TG: CountryData;
export const TK: CountryData;
export const TO: CountryData;
export const TT: CountryData;
export const TN: CountryData;
export const TR: CountryData;
export const TM: CountryData;
export const TC: CountryData;
export const TV: CountryData;
export const UG: CountryData;
export const UA: CountryData;
export const AE: CountryData;
export const GB: CountryData;
export const US: CountryData;
export const UM: CountryData;
export const UY: CountryData;
export const UZ: CountryData;
export const VU: CountryData;
export const VE: CountryData;
export const VN: CountryData;
export const VG: CountryData;
export const VI: CountryData;
export const WF: CountryData;
export const EH: CountryData;
export const YE: CountryData;
export const ZM: CountryData;
export const ZW: CountryData;
export const AF: CountryData;
export const AX: CountryData;
export const AL: CountryData;
export const DZ: CountryData;
export const AS: CountryData;
export const AD: CountryData;
export const AO: CountryData;
export const AI: CountryData;
export const AQ: CountryData;
export const AG: CountryData;
export const AR: CountryData;
export const AM: CountryData;
export const AW: CountryData;
export const AU: CountryData;
export const AT: CountryData;
export const AZ: CountryData;
export const BS: CountryData;
export const BH: CountryData;
export const BD: CountryData;
export const BB: CountryData;
export const BY: CountryData;
export const BE: CountryData;
export const BZ: CountryData;
export const BJ: CountryData;
export const BM: CountryData;
export const BT: CountryData;
export const BO: CountryData;
export const BQ: CountryData;
export const BA: CountryData;
export const BW: CountryData;
export const BV: CountryData;
export const BR: CountryData;
export const IO: CountryData;
export const BN: CountryData;
export const BG: CountryData;
export const BF: CountryData;
export const BI: CountryData;
export const KH: CountryData;
export const CM: CountryData;
export const CA: CountryData;
export const CV: CountryData;
export const KY: CountryData;
export const CF: CountryData;
export const TD: CountryData;
export const CL: CountryData;
export const CN: CountryData;
export const CX: CountryData;
export const CC: CountryData;
export const CO: CountryData;
export const KM: CountryData;
export const CG: CountryData;
export const CD: CountryData;
export const CK: CountryData;
export const CR: CountryData;
export const CI: CountryData;
export const HR: CountryData;
export const CU: CountryData;
export const CW: CountryData;
export const CY: CountryData;
export const CZ: CountryData;
export const DK: CountryData;
export const DJ: CountryData;
export const DM: CountryData;
export const DO: CountryData;
export const EC: CountryData;
export const EG: CountryData;
export const SV: CountryData;
export const GQ: CountryData;
export const ER: CountryData;
export const EE: CountryData;
export const ET: CountryData;
export const FK: CountryData;
export const FO: CountryData;
export const FJ: CountryData;
export const FI: CountryData;
export const FR: CountryData;
export const GF: CountryData;
export const PF: CountryData;
export const TF: CountryData;
export const GA: CountryData;
export const GM: CountryData;
export const GE: CountryData;
export const DE: CountryData;
export const GH: CountryData;
export const GI: CountryData;
export const GR: CountryData;
export const GL: CountryData;
export const GD: CountryData;
export const GP: CountryData;
export const GU: CountryData;
export const GT: CountryData;
export const GG: CountryData;
export const GN: CountryData;
export const GW: CountryData;
export const GY: CountryData;
export const HT: CountryData;
export const HM: CountryData;
export const VA: CountryData;
export const HN: CountryData;
export const HK: CountryData;
export const HU: CountryData;
export const IS: CountryData;
export const IN: CountryData;
export const ID: CountryData;
export const IR: CountryData;
export const IQ: CountryData;
export const IE: CountryData;
export const IM: CountryData;
export const IL: CountryData;
export const IT: CountryData;
export const JM: CountryData;
export const JP: CountryData;
export const JE: CountryData;
export const JO: CountryData;
export const KZ: CountryData;
export const KE: CountryData;
export const KI: CountryData;
export const KP: CountryData;
export const KR: CountryData;
export const XK: CountryData;
export const KW: CountryData;
export const KG: CountryData;
export const LA: CountryData;
export const LV: CountryData;
export const LB: CountryData;
export const LS: CountryData;
export const LR: CountryData;
export const LY: CountryData;
export const LI: CountryData;
export const LT: CountryData;
export const LU: CountryData;
export const MO: CountryData;
export const MK: CountryData;
export const MG: CountryData;
export const MW: CountryData;
export const MY: CountryData;
export const MV: CountryData;
export const ML: CountryData;
export const MT: CountryData;
export const MH: CountryData;
export const MQ: CountryData;
export const MR: CountryData;
export const MU: CountryData;
export const YT: CountryData;
export const MX: CountryData;
export const FM: CountryData;
export const MD: CountryData;
export const MC: CountryData;
export const MN: CountryData;
export const ME: CountryData;
export const MS: CountryData;
export const MA: CountryData;
export const MZ: CountryData;
export const MM: CountryData;
export const NA: CountryData;
export const NR: CountryData;
export const NP: CountryData;
export const NL: CountryData;
export const NC: CountryData;
export const NZ: CountryData;
export const NI: CountryData;
export const NE: CountryData;
export const NG: CountryData;
export const NU: CountryData;
export const NF: CountryData;
export const MP: CountryData;
export const NO: CountryData;
export const OM: CountryData;
export const PK: CountryData;
export const PW: CountryData;
export const PS: CountryData;
export const PA: CountryData;
export const PG: CountryData;
export const PY: CountryData;
export const PE: CountryData;
export const PH: CountryData;
export const PN: CountryData;
export const PL: CountryData;
export const PT: CountryData;
export const PR: CountryData;
export const QA: CountryData;
export const RE: CountryData;
export const RO: CountryData;
export const RU: CountryData;
export const RW: CountryData;
export const BL: CountryData;
export const SH: CountryData;
export const KN: CountryData;
export const LC: CountryData;
export const MF: CountryData;
export const PM: CountryData;
export const VC: CountryData;
export const WS: CountryData;
export const SM: CountryData;
export const ST: CountryData;
export const SA: CountryData;
export const SN: CountryData;
export const RS: CountryData;
export const SC: CountryData;
export const SL: CountryData;
export const SG: CountryData;
export const SX: CountryData;
export const SK: CountryData;
export const SI: CountryData;
export const SB: CountryData;
export const SO: CountryData;
export const ZA: CountryData;
export const GS: CountryData;
export const SS: CountryData;
export const ES: CountryData;
export const LK: CountryData;
export const SD: CountryData;
export const SR: CountryData;
export const SZ: CountryData;
export const SE: CountryData;
export const CH: CountryData;
export const SY: CountryData;
export const TW: CountryData;
export const TJ: CountryData;
export const TZ: CountryData;
export const TH: CountryData;
export const TL: CountryData;
export const TG: CountryData;
export const TK: CountryData;
export const TO: CountryData;
export const TT: CountryData;
export const TN: CountryData;
export const TR: CountryData;
export const TM: CountryData;
export const TC: CountryData;
export const TV: CountryData;
export const UG: CountryData;
export const UA: CountryData;
export const AE: CountryData;
export const GB: CountryData;
export const US: CountryData;
export const UM: CountryData;
export const UY: CountryData;
export const UZ: CountryData;
export const VU: CountryData;
export const VE: CountryData;
export const VN: CountryData;
export const VG: CountryData;
export const VI: CountryData;
export const WF: CountryData;
export const EH: CountryData;
export const YE: CountryData;
export const ZM: CountryData;
export const ZW: CountryData;
}

@@ -140,3 +140,3 @@ var _ = require('underscore');

`;
typingsOutput += countryShortCodes.map((shortCode) => `export const ${shortCode}: CountryData;`).join("\n");
typingsOutput += countryShortCodes.map((shortCode) => `\texport const ${shortCode}: CountryData;`).join("\n");
typingsOutput += '\n}\n';

@@ -143,0 +143,0 @@

The MIT License (MIT)
Copyright (c) 2021 Benjamin Keen
Copyright (c) 2022 Benjamin Keen

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "country-region-data",
"version": "2.0.0-beta.3",
"version": "2.0.0",
"description": "List of countries, regions, and their shortcodes.",

@@ -5,0 +5,0 @@ "main": "dist/data.js",

# country-region-data
> Dec 20th, 2021: this repo will be in limbo for a few days. I'll update the doc and release a new version when we're good to go. Keep
> you posted.
[![Build Status](https://travis-ci.com/country-regions/country-region-data.svg?branch=master)](https://travis-ci.org/country-regions/country-region-data)
This repo contains a static JSON file of country names, country short codes, country regions, and country region short
This repo provides country and region data in three different formats: es6, UMD (Unified Module Definition) and
plain JSON. The data contains country names, country short codes, country regions, and country region short
codes. All country names and short codes are guaranteed to be unique. Similarly, all regions and region short

@@ -27,3 +25,3 @@ codes *within a single country* are guaranteed to be unique.

See the `data.json` file for the data. The JSON is of the form:
See the `data.json` file in the root folder for the raw data. The JSON is of the form:

@@ -41,3 +39,3 @@ ```javascript

...
}
]
},

@@ -48,11 +46,50 @@ ...

Note: the `data.js` file is an UMD version of the data.json file, generated automatically. The `data.json` file is the
source of truth for the data set.
The `data.json` file is the source of truth for the data set, but the generated build artifacts (not seen the repo -
only in the npm package) are:
```
dist/data.js
dist/data-umd.js
```
The first one is an es6 file containing all the data in tree-shakeable format; the second is an UMD file containing the
entire content. Up until v2 of this repo, UMD was the default. Now
### How to use
The es6 file can be imported like so:
```jsx harmony
import { allCountries } from 'country-region-data';
```
If you're using typescript you'll get all the typings and see the structure of the exported data in your IDE. If not,
check your node_modules/country-region-data/dist folder and look at the `data.d.ts` file to get the full list of exported
information.
The UMD file can be used like this:
```
import countryRegionData from 'country-region-data/dist/data-umd';
```
The raw JSON like this:
```
import json from 'country-region-data/data.json';
```
### Typings
So this bit I'm not sure about... so ping me if I'm wrong or if there's a better way to do it. There are three
different formats for the repo data: JSON, UMD and ES6. I figure es6 is going to be the most likely used format, so the
generated typings file (data.d.ts) is referenced in the "typings" property in the package.json file and should be picked
up by your IDEs.
There are no typings for the UMD or JSON format.
### Contribute
**IMPORTANT**: make your changes to the `data.json` file, not the `data.js` file. The JS file is generated automatically out of
the `data.json` file by running `grunt umdify` on the command line. So if you add your change to the JS file only, they
will get overwritten next time that command is run.
Make your changes to the `data.json` file.

@@ -64,4 +101,4 @@ Updates and fixes to the data is much appreciated! The state/prov abbreviations in particular are not yet complete, so

```
npm install
grunt findIncomplete
yarn install
npx grunt findIncomplete
```

@@ -79,4 +116,4 @@

```
npm install
grunt validate
yarn install
npx grunt validate
```

@@ -96,2 +133,5 @@

- `2.0.0` - Jan 4, 2022.
- New export formats: es6 (default) as well as the old UMD and JSON.
- Data updates for France, Bolivia, Vietnam.
- `1.11.0` - Sept 22, 2021. Data updates: Vietnam. Thanks [barnett](https://github.com/barnett)!

@@ -98,0 +138,0 @@ - `1.10.0` - Aug 10, 2021. Data updates: India, Nepal, Moldova regions. Thanks all!

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc