@desoukysvyc/data-collector
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

@desoukysvyc/data-collector

The @desoukysvyc/data-collector npm package is a comprehensive collection of data related to ISO standard codes. It provides a simple and efficient way to access information about countries, languages, currencies, and more, based on ISO standards.

npm version

License

Installation

Install @desoukysvyc/data-collector with npm

  npm install @desoukysvyc/data-collector

Usage/Examples

Querying Countries

The package provides a convenient query method for filtering countries based on various criteria. Example:

import { countries } from "@desoukysvyc/data-collector";

const filteredCountries = countries.query({
  alpha2: "US",
  currencies: ["USD"],
  languages: ["eng"],
});

console.log(filteredCountries);

Output

[
    {
        "name": "United States",
        "alpha2": "US",
        "alpha3": "USA",
        "callingCode": "+1",
        "capital": "Washington, D.C.",
        "currencies": [
            "USD",
            "USN"
        ],
        "internetTld": [
            ".us"
        ],
        "languages": [
            "eng"
        ],
        "numericCode": "840",
        "officialName": "The United States of America",
        "secondaryName": "United States of America"
    },
]

Find countries with a specific calling code

const countriesWithCallingCode = countries.query({ callingCode: "+20" });

Output

[
     {
        "name": "Egypt",
        "alpha2": "EG",
        "alpha3": "EGY",
        "callingCode": "+20",
        "capital": "Cairo",
        "currencies": [
            "EGP"
        ],
        "internetTld": [
            ".eg"
        ],
        "languages": [
            "ara"
        ],
        "numericCode": "818",
        "officialName": "The Arab Republic of Egypt",
        "secondaryName": "Egypt"
    },
]

Accessing Football Federations

~ Including England,Scotland,etc.

import { countriesFootballFederations } from "@desoukysvyc/data-collector";

console.log(countriesFootballFederations);

Output

[
  {
    name: 'Albania',
    alpha2: 'AL',
    alpha3: 'ALB',
    internetTld: [ '.al' ],
    numericCode: '008',
    officialName: 'The Republic of Albania',
    country: 'Albania',
    code: 'ALB',
    federation: 'Albanian Football Association'
  },
  {
    name: 'Algeria',
    alpha2: 'DZ',
    alpha3: 'DZA',
    internetTld: [ '.dz' ],
    numericCode: '012',
    officialName: "The People's Democratic Republic of Algeria",
    country: 'Algeria',
    code: 'ALG',
    federation: 'Algerian Football Federation'
  },
  {
    country: 'England',
    code: 'ENG',
    federation: 'The Football Association'
  }
  ...169 more items
]

Advanced Querying with Lodash

Utilize the power of lodash functions to perform advanced queries:

import { countries } from "@desoukysvyc/data-collector";
import { filter, map, keyBy } from "lodash";

// Map countries to an object for quick lookup
const countriesMap = keyBy(countries, "alpha2");
const usaInfo = countriesMap["US"];

License

This project is licensed under the MIT License

Support and Donation

Support

If you encounter any issues or have questions about the @desoukysvyc/data-collector package, feel free to open an issue on the GitHub repository. We welcome your feedback and contributions!

Readme

Keywords

none

Package Sidebar

Install

npm i @desoukysvyc/data-collector

Weekly Downloads

5

Version

0.2.2

License

MIT

Unpacked Size

4.46 MB

Total Files

36

Last publish

Collaborators

  • desouky