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

world-countries-json

v1.0.0

Published

Comprehensive JSON data for 249 countries and territories with multiple search methods

Readme

World-Countries-JSON 🌍

npm version License: MIT

World-Countries-JSON is a comprehensive, high-performance dataset and library providing detailed information for 249 countries and territories worldwide. From basic ISO codes to travel-specific data like plug types and emergency numbers, this package is designed for modern web applications that need reliable global data.


🚀 Features

  • 🌍 Global Coverage: Comprehensive data for 249 countries and overseas territories.
  • 🔍 Advanced Search: Search by Alpha-2, Alpha-3, ISO Numeric, or Country Name (case-insensitive).
  • ⚡ Super Fast: Optimized for quick lookups via pre-indexed data.
  • 🛡️ Travel Ready: Includes plug types, driving side, emergency contacts, and tipping etiquette.
  • 📦 Zero Dependencies: Lightweight and reliable.
  • 💾 Offline First: All data is local—no external API calls required.

📦 Installation

npm install world-countries-json

🛠 Usage

Basic Usage

const countries = require("world-countries-json");

// Get country by Alpha-2 code
const uk = countries.getCountry("GB");
console.log(uk.country_name); // "United Kingdom"
console.log(uk.capital); // "London"

Search Methods

| Method | Description | Example | | :-------------------- | :--------------------------------------- | :--------------------------------- | | getCountry(query) | Smart search (auto-detects code or name) | countries.getCountry('US') | | getByAlpha2(code) | Search by 2-letter ISO code | countries.getByAlpha2('FR') | | getByAlpha3(code) | Search by 3-letter ISO code | countries.getByAlpha3('DEU') | | getByISO(code) | Search by ISO Numeric code | countries.getByISO('250') | | getByName(name) | Search by full country name | countries.getByName('France') | | searchByName(query) | Partial name search (returns array) | countries.searchByName('united') |


📄 Data Structure

Each country entry is a rich JSON object:

{
  "id": "826",
  "iso": "GBR",
  "alpha_2": "GB",
  "country_name": "United Kingdom",
  "cover_image": "",
  "flag_url": "https://flagcdn.com/gb.svg",
  "short_description": "The United Kingdom is an island nation in northwestern Europe, known for its global cultural influence and historic landmarks.",
  "known_for": [
    {
      "title": "🏰 Buckingham Palace & Royalty",
      "color": "gray"
    },
    {
      "title": "🕰️ Big Ben & Westminster",
      "color": "brown"
    },
    {
      "title": "🪨 Stonehenge",
      "color": "gray"
    },
    {
      "title": "🎓 Oxford & Cambridge Universities",
      "color": "blue"
    },
    {
      "title": "⚽ Premier League Football",
      "color": "red"
    }
  ],
  "capital": "London",
  "major_cities": [
    "London",
    "Birmingham",
    "Glasgow",
    "Liverpool",
    "Manchester",
    "Edinburgh",
    "Bristol"
  ],
  "official_language": ["English"],
  "currency": {
    "title": "Pound Sterling",
    "symbol": "£"
  },
  "major_religions": "Christianity (60%)",
  "national_day": {
    "title": "King's Official Birthday",
    "date": "Occurs in June"
  },
  "phone": {
    "digital_code": "+44",
    "phone_operators": ["EE", "O2", "Vodafone UK", "Three"]
  },
  "plug_types": ["G"],
  "transport": {
    "driving_side": "Left",
    "taxi": ["Uber", "Free Now", "Black Cabs"],
    "metro": [
      "London Underground (The Tube)",
      "Glasgow Subway",
      "Tyne and Wear Metro"
    ]
  },
  "health": {
    "tap_water_safety": "Safe to drink",
    "alcohol_consumption_age": "18 years old",
    "alcohol_parchase_age": "18 years old",
    "alcohol_info": [
      "Legal age is 18",
      "Iconic pub culture with vast ales and spirits tradition"
    ]
  },
  "money": {
    "tipping": {
      "hotels": "£1-2 per bag",
      "guides": "10% for private tours",
      "restaurants": "10-15% is standard",
      "taxis": "Rounding up the fare"
    }
  },
  "weather": {
    "title": "The UK has a temperate maritime climate with cool winters and warm summers.",
    "when_to_visit": [
      {
        "icon": "🌤️",
        "title": "Late Spring / Summer",
        "time_period": "May to September",
        "short_description": "Longest days and warmest weather."
      },
      {
        "icon": "🎄",
        "title": "Christmas Season",
        "time_period": "December",
        "short_description": "Festive markets and lights, though cold."
      }
    ],
    "best_time": "The best time to visit is from June to August."
  },
  "emergency": [
    {
      "title": "Emergency Services",
      "number": "999"
    },
    {
      "title": "Emergency (EU standard)",
      "number": "112"
    },
    {
      "title": "Non-emergency Police",
      "number": "101"
    },
    {
      "title": "Non-emergency Medical",
      "number": "111"
    }
  ]
}

🤝 Contributing

We welcome contributions to keep the data accurate and up-to-date!

How to Contribute

  1. Fork the repository.
  2. Add/Modify data: If you are adding a new country, use the template.json as your guide.
  3. Validate:
    • Ensure your JSON follows the exact structure of template.json.
    • Your contribution must pass the schema validation.
    • Run npm run test to verify your changes.
  4. Submit a Pull Request.

[!IMPORTANT] All new data entries must follow the template.json structure strictly to ensure compatibility with our indexing engine.


📜 License

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


🔗 Links


Developed with ❤️ by Marian Dudych