Giter Club home page Giter Club logo

country-tz-currency's Introduction

country-tz-currency

Install

npm install country-tz-currency --save

Usage

var ctzc 	=	require('country-tz-currency');

ctzc.getAllCountries() //Returns list of country objects

ctzc.getAllTimezones() //Returns list of timezone objects

ctzc.getAllCurrencies() //Returns list of currency objects
ctzc.getCountryByCode( "US" ) //Expects two digit country code
//Returns : Country object
//{
//  "countryName":"United States",
//  "countryNumber":"840",
//  "alpha3":"USA",
//  "areaCode":"+1",
//  "currencyCode":"USD",
//  "timeZone":[ "America/New_York" , "America/Detroit" , "America/Kentucky/Louisville" , "America/Kentucky/Monticello" , "America/Indiana/Indianapolis" , "America/Indiana/Vincennes" , "America/Indiana/Winamac" , "America/Indiana/Marengo" , "America/Indiana/Petersburg" , "America/Indiana/Vevay" , "America/Chicago" , "America/Indiana/Tell_City" , "America/Indiana/Knox" , "America/Menominee" , "America/North_Dakota/Center" , "America/North_Dakota/New_Salem" , "America/North_Dakota/Beulah" , "America/Denver" , "America/Boise" , "America/Phoenix" , "America/Los_Angeles" , "America/Anchorage" , "America/Juneau" , "America/Sitka" , "America/Yakutat" , "America/Nome" , "America/Adak" , "America/Metlakatla" , "Pacific/Honolulu" ],
//  "capital":"Washington, D.C."
//}
ctzc.getCurrencyByCode( "USD" ) //Expects three digit currency code
//Returns : Currency object
//{
//    "symbol": "$",
//    "name": "US Dollar",
//    "symbol_native": "$",
//    "decimal_digits": 2,
//    "rounding": 0,
//    "code": "USD",
//    "name_plural": "US dollars"
//}
ctzc.getCurrencyByCountryCode( "US" ) //Expects two digit country code
//Returns : Currency object
//{
//    "symbol": "$",
//    "name": "US Dollar",
//    "symbol_native": "$",
//    "decimal_digits": 2,
//    "rounding": 0,
//    "code": "USD",
//    "name_plural": "US dollars"
//}
ctzc.getTzById( "America/New_York" ) //Expects timezone id
//Returns : Timezone object
//{
//    "displayName":"Eastern Standard Time",
//    "isObserveDST":"true",
//    "dstOffset":3600000,
//    "offset":-18000000,
//    "GMT":"-5:00",
//    "id":"America/New_York"
//}
ctzc.getTzIdsByCountryCode( "US" ) //Expects two digit country code
//Returns : Array of timezone-ids
//[ "America/New_York" , "America/Detroit" , "America/Kentucky/Louisville" , "America/Kentucky/Monticello" , "America/Indiana/Indianapolis" , "America/Indiana/Vincennes" , "America/Indiana/Winamac" , "America/Indiana/Marengo" , "America/Indiana/Petersburg" , "America/Indiana/Vevay" , "America/Chicago" , "America/Indiana/Tell_City" , "America/Indiana/Knox" , "America/Menominee" , "America/North_Dakota/Center" , "America/North_Dakota/New_Salem" , "America/North_Dakota/Beulah" , "America/Denver" , "America/Boise" , "America/Phoenix" , "America/Los_Angeles" , "America/Anchorage" , "America/Juneau" , "America/Sitka" , "America/Yakutat" , "America/Nome" , "America/Adak" , "America/Metlakatla" , "Pacific/Honolulu" ]
ctzc.getTzsByCountryCode( "GB" ) //Expects two digit country code
//Returns : Array of timezones
//[{
//    "displayName":"Greenwich Mean Time",
//    "isObserveDST":"true",
//    "dstOffset":3600000,
//    "offset":0,
//    "GMT":"0:00",
//    "id":"Europe/London"
//}]

Note:

  • Returns undefined for invalid param

country-tz-currency's People

Contributors

anand6588 avatar karthikeyan-amaresan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.