Socket
Socket
Sign inDemoInstall

@erboladaiorg/distinctio-voluptates-officia

Package Overview
Dependencies
30
Maintainers
0
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erboladaiorg/distinctio-voluptates-officia

Planetary Dials is a utility library for mapping country codes, dial codes, and their flags.


Version published
Weekly downloads
425
increased by12.43%
Maintainers
0
Created
Weekly downloads
 

Readme

Source

Planetary Dials 🌍

Planetary Dials is a utility library for mapping country codes, dial codes, and their flags.

Installation

To install this library, you can use the following command:

npm install --save @erboladaiorg/distinctio-voluptates-officia

Usage

Here's an example of how you can use this library in your code:

import {
    Country,
    getPlanetaryDials,
    getCountryDialCode,
    getCountryFlag,
    getCountryName
} from "@erboladaiorg/distinctio-voluptates-officia";

// all countries

console.log(getPlanetaryDials());
/*
{
  AF: {
    flag: 'https://flagsapi.com/AF/shiny/64.png',
    code: 'AF',
    name: 'Afghanistan',
    dialCode: '+93'
  },
  AX: {
    flag: 'https://flagsapi.com/AX/shiny/64.png',
    code: 'AX',
    name: 'Aland Islands',
    dialCode: '+358'
  },
  ...
}
*/


// one country
console.log(getCountryDialCode(Country.AF));
// +93

console.log(getCountryFlag(Country.AF));
// https://flagsapi.com/AF/shiny/64.png

console.log(getCountryName(Country.AF));
// Afghanistan


// multiple countries
const countryCodes: Country[] = [Country.US, Country.CA];
const result = getMultipleCountryDialInfo(countryCodes);
console.log(result);
/*
[
  {
    flag: 'https://flagsapi.com/US/shiny/64.png',
    code: 'US',
    name: 'United States',
    dialCode: '+1'
  },
  {
    flag: 'https://flagsapi.com/CA/shiny/64.png',
    code: 'CA',
    name: 'Canada',
    dialCode: '+1'
  }
]
*/

Contributing

Contributions to this project are welcome. Please open an issue or pull request on GitHub.

License

This project is licensed under the ISC license.

This library is inspired by michaelolof's country-flags-dial-codes".

Keywords

FAQs

Last updated on 16 Jul 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc