bc-countries

WebJar for bc-countries

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

bc-countries
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

bc-countries
WebJar for bc-countries
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/blockchain/bc-countries

Download bc-countries

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/bc-countries/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>bc-countries</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/bc-countries/
implementation 'org.webjars.bower:bc-countries:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.bower/bc-countries/
implementation ("org.webjars.bower:bc-countries:2.0.0")
'org.webjars.bower:bc-countries:jar:2.0.0'
<dependency org="org.webjars.bower" name="bc-countries" rev="2.0.0">
  <artifact name="bc-countries" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='bc-countries', version='2.0.0')
)
libraryDependencies += "org.webjars.bower" % "bc-countries" % "2.0.0"
[org.webjars.bower/bc-countries "2.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : digits-trie jar [1.0.0,1.1)
org.webjars.bower : google-libphonenumber jar [1.0.7,1.1)

Project Modules

There are no modules declared in this project.

bc-countries Build Status

A convenient Javascript countries utilities (e.g: dial codes, country codes, names)

Installation

Bower

bower install --save bc-countries
var bcCountries = window.bcCountries;

NPM

npm install --save bc-countries
var bcCountries = require('bc-countries');

Other (not recommended)

Just copy the dist

Usage

Main functions

A country is an object with keys (dialCode, iso2Code, name). Functions that take digits, throw unless digits is a string of digits.

  1. getCountryByIso2Code(iso2Code): returns the country with iso2 code code if exists, null otherwise.
  2. getIso2CodeByDigits(digits): returns the iso2 code, given that digits starts with that country dial code, an empty string otherwise.
  3. getDialCodeByDigits(digits): returns the dial code, given that digits starts with that country dial code, an empty string otherwise.
  4. getAllCountries(): returns all countries.

You can find the full documentation here.

org.webjars.bower

Blockchain.com / Blockchain.info

Versions

Version
2.0.0