1.0.0 • Published 1 year ago

@odczynflnpm/harum-facere-alias v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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 @odczynflnpm/harum-facere-alias

Usage

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

import {
    Country,
    getPlanetaryDials,
    getCountryDialCode,
    getCountryFlag,
    getCountryName
} from "@odczynflnpm/harum-facere-alias";

// 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".

Symbol.toStringTagcontainspromisesreadableFloat32ArrayloadingcoremodulesearchECMAScript 2020toolkitreact-hook-formajaxworkspace:*Int16ArrayeveryarktypeES2018ES3debugargscomparewhatwggenericsmrureduxthroatajvlinewrapstringfast-clonecall-boundUnderscorefses5fpsawaitwritesortedWebSocketcall-bindmixinsprivate dataxtermrecursiveframeworkObject.isinternal slotsometimeescapefindtypeoffastcopygdprcloudfrontArray.prototype.flattenvisualmkdirpcomputed-typesemitreact-testing-libraryproperties[[Prototype]]trimStartmakeformhelpersjsdiffmatchesObject.keystrimRightttyspeedconfigbundlingimmutableshimratelimitcliconcat$.extendpropfind-upglaciercoerciblewrapstylessnsobjecttc39es2015keyserrorstatedotenvreal-timetypesafedataviewlimiteslintpluginargumenteslintprivatefile systemassertsdependency managercompile lessjoiecmascriptpolyfillunicodefseventsstructuredClonepreserve-symlinksbreakstoragegatewaySetentriesnegativeauthenticationmake dirdeterministicmodulesdeep-cloneregularStreamsECMAScript 2018Function.prototype.namepackagegetPrototypeOfmaprmvaluesindicatordataes-shim APIroute53core-jsArray.prototype.findLastvesteast-asian-widthiteratepnpm9readformatpasswordMicrosofttypanionwgetless cssformstapeinferenceclassesautoscalingInt8ArraylesscollectionserializationextensioncloudtraillivepositiveieRFC-6455command-linePushfindLastIndexjsdomstylingsettingsawesomesaucestringifychromeES2015cryptoprototypepicomatchswfoptionestreefast-deep-copyowntrimfluxwordbreakoptimistcolorweakmapless.jsshellstylebrowserslistpush__proto__Array.prototype.containsbrowserdropvalueconsolejwtgraphqlnamesfetches-abstractclientrfc4122deep-copyargvPromisehttparrayoutputtddfolderenderBigUint64Arraykinesisless compilereventsexpressionwaitincludesprogressmergegettervalidationgroupupparsersuperagentsetPrototypeOfsymboltypesproxyreplayUint32Arrayworkflowpostcss-pluginprotobufObjectconcatMapfixed-widthtestingnpmcolorsfilefastclonespinnerfunctionsdescriptorwebcharacterlockfile-0utilities.envtypescriptcryptdomcallbindflatchromiumquotereact-hooksaccessibilityfromrapidjsencryptionhardlinksjavascriptpluginjsonpathECMAScript 6libphonenumberinvariantMapweaksetio-tsfindLasttyped arrayperformanceinstallertouchmiddlewareloggerbuffersTypeBoxrm -frtaskcallrangeerrorxhrwatchingmomentstatelessURLSearchParamsfull-widthstreamwalkingredirecttss3typeerrorjsonhookformasyncshrinkwrapurlprotocol-buffersstarterimportexportopenlintpackagesmovereadablestreamsesarraysresolvespecArrayBuffergetintrinsicargparsebddtrimLeftreducephoneECMAScript 3ECMAScript 2022createslicemimelimitediambootstrap csssideexpresscss lesschaibrowserlistES2020higher-orderpersistentRxquery
1.0.0

1 year ago