npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

isoc

v0.0.1

Published

A list of country names and codes as published by the ISO 3166-1 standard

Downloads

15,459

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

npm version build 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

  1. Country Codes - ISO 3166
  2. OpenKnowledge Data
  3. Wikipedia
  4. Zuora

License

MIT