isoc
v0.0.1
Published
A list of country names and codes as published by the ISO 3166-1 standard
Downloads
15,459
Maintainers
Readme
isoc
A list of country names (official short names in English) and codes as published by the ISO 3166-1 standard, including their corresponding numeric, alpha-2 and alpha-3 codes [2, 3, 4].
Status
Installation
Install the package via npm
:
npm install --save isoc
Usage
var countries = require('isoc');
// Exclude all but `officially-assigned` countries.
countries.filter(function(country) {
return country.status === 'officially-assigned';
}).length;
// => 249
Exceptions
The status
property can be used to distinguish between Officially Assigned (officially-assigned
), Transitionally reserved (transitionally-reserved
) and User-assigned (user-assigned
) code elements. Indeterminate reservations haven't been considered for now.
Transitional reservations
Transitionally-reserved code elements are codes reserved after being deleted from ISO 3166-1. It is only possible to use them during a transitional period of at least five years, while new code elements that may have replaced them are taken into use. At the end of their expiration date, they may be reassigned [1].
Currently, this list includes the following transitionally-reserved countries:
- Burma (reserved from 1989-12 to 2039-12)
- East Timor (reserved from 2002-05 to 2052-05)
- Netherlands Antilles (reserved from 2010-12 to 2060-12)
- Neutral Zone (reserved from 1993-07 to 2043-07)
- Serbia and Montenegro (reserved from 2006-09 to 2056-09)
- Yugoslavia (reserved from 2003-07 to 2053-07)
- Zaire (reserved from 1997-07 to 2047-07)
User-assigned code elements
On ISO 3166-1:2013, clause 8.1.3 ("User-assigned code elements") reads:
If users need code elements to represent country names not included in this part of ISO 3166, the series of letters AA, QM to QZ, XA to XZ, and ZZ, and the series AAA to AAZ, QMA to QZZ, XAA to XZZ, and ZZA to ZZZ respectively and the series of numbers 900 to 999 are available.
While not strictly related to the purpose of identifying a country, user-assigned code elements can be used to temporarily represent a new country code. However, a new country can only enter the official ISO 3166-1 standard if it is registered in the United Nations Terminology Bulletin Country Names or in the Country and Region Codes for Statistical Use of the UN Statistics Division [3].
For example, "XK" / "XKX" is being used by the European Commission, Switzerland, Deutsche Bundesbank, SWIFT and other organizations as a temporary country code for Kosovo
[3]. It the only user-assigned code element included in this package.
Tests
npm test
Sources
License
MIT