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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vsc_cnst/countries-info

v1.0.0

Published

A TypeScript library that provides detailed information about countries, including their names, languages, translations, and other metadata.

Readme

Country Information Library

A TypeScript library that provides detailed information about countries, including their names, languages, translations, and other metadata.

Installation

To install this library, run the following:

npm install your-repository-name

Usage

You can use the Country type to define a country object with the structure outlined above. Here's an example:

import { Country } from 'your-repository-name';

const country: Country = {
  name: {
    common: 'Canada',
    official: 'Canada',
    native: { common: 'Canada', official: 'Canada' },
  },
  tld: ['.ca'],
  cca2: 'CA',
  ccn3: '124',
  cca3: 'CAN',
  currency: ['CAD'],
  callingCode: ['1'],
  capital: 'Ottawa',
  altSpellings: ['CA'],
  relevance: 'high',
  region: 'Americas',
  subregion: 'Northern America',
  nativeLanguage: 'eng',
  languages: { eng: 'English', fra: 'French' },
  translations: { deu: 'Kanada', fra: 'Canada' },
  latlng: [56.1304, -106.3468],
  demonym: 'Canadian',
  borders: ['USA'],
  area: 9984670,
};

Types

NativeNames

Represents the native names of a country in its native language.

type NativeNames = {
  common?: string;
  official?: string;
};

Translations

Represents translations of a country's name in various languages.

type Translations = {
  [cca3: string]: string | undefined; // Language code as key and translated name as value
};

Languages

Represents the languages spoken in a country.

type Languages = {
  [cca3: string]: string | undefined; // Language code as key and language name as value
};

Country

Represents detailed information about a country, including its name, languages, borders, area, and more.

type Country = {
  name: {
    common: string;
    official: string;
    native: NativeNames;
  };
  tld: string[];
  cca2: string;
  ccn3: string;
  cca3: string;
  currency: string[];
  callingCode: string[];
  capital: string;
  altSpellings: string[];
  relevance: string;
  region: string;
  subregion: string;
  nativeLanguage: string;
  languages: Languages;
  translations: Translations;
  latlng: number[];
  demonym: string;
  borders: string[];
  area: number;
};

Disclaimer

This project is a work in progress and may not be fully accurate or up-to-date. Please verify the information in this library before using it for any critical application. The authors are not responsible for any inaccuracies or errors in the data provided.

This library includes data sourced from restcountries repository, which is maintained by others. While every effort is made to keep the data accurate and up-to-date, we cannot guarantee its completeness or correctness. Please verify the data independently for critical applications. The authors of this library are not responsible for any inaccuracies or errors in the external data provided.

License

This project is licensed under the MIT License - see the LICENSE file for details.