Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

countries-list-json

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

countries-list-json

A simple npm package for a list of countries in JSON format

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
14
-6.67%
Maintainers
0
Weekly downloads
 
Created
Source

countries-list-json

NPM Version Downloads Stats

A comprehensive list of countries and their details in JSON format. Useful for applications that need country data for various purposes such as dropdowns, validations, etc.

Installation

To install this package, run:

npm install countries-list-json

Usage

Here is a basic example of how to use this package:

const countries = require('countries-list-json');

// Example usage
console.log(countries); // Prints the entire list of countries

// Accessing specific country details
const zambia = countries.find(country => country.code === 'ZM');
console.log(zambia); // { name: 'Zambia', code: 'ZM', dial_code: '+260', flag: '🇿🇲' }

API

The package exports a JSON array of country objects. Each country object contains the following properties:

  • name (String): The name of the country.
  • code (String): The ISO 3166-1 alpha-2 code of the country.
  • dial_code (String): The international dialing code of the country.
  • flag (String): The flag emoji of the country.

Example Country Object

{
  "name": "Zambia",
  "code": "ZM",
  "dial_code": "+260",
  "flag": "🇿🇲"
}

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any bugs or features.

  • Fork the repository
  • Create a new branch (git checkout -b feature-branch)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin feature-branch)
  • Open a pull request

License

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

Acknowledgements

  • Thank you to everyone who has contributed to this project.

Keywords

countries

FAQs

Package last updated on 27 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts