-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Clifftech123/dev
Dev
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'countrydata.js': patch | ||
--- | ||
|
||
Fix: Resolved the GitHub repository connection problem with npm and added a sample index.js. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const countrydata_js_1 = require("countrydata.js"); | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const countryHelper = new countrydata_js_1.CountryHelper(); | ||
const allCountries = yield countryHelper.getCountries(); | ||
console.log(JSON.stringify(allCountries, null, 2)); | ||
}))(); | ||
// Get country by short code | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const countryHelper = new countrydata_js_1.CountryHelper(); | ||
const countryData = yield countryHelper.getCountryByShortCode('US'); | ||
console.log(countryData); | ||
}))(); | ||
// Get regions in a particular country | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const countryHelper = new countrydata_js_1.CountryHelper(); | ||
const regionsData = yield countryHelper.getRegionsByCountryShortCode('GH'); | ||
console.log(regionsData); | ||
}))(); | ||
// Get country Country Flag | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const countryHelper = new countrydata_js_1.CountryHelper(); | ||
const countryData = yield countryHelper.getCountryByShortCode('US'); | ||
console.log(countryData === null || countryData === void 0 ? void 0 : countryData.countryFlag); | ||
}))(); | ||
// Get country by phone code | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const countryHelper = new countrydata_js_1.CountryHelper(); | ||
const countryData = yield countryHelper.getCountryByPhoneCode('+233'); | ||
console.log(countryData); | ||
}))(); | ||
// Get country phone code by short code | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const countryHelper = new countrydata_js_1.CountryHelper(); | ||
const phoneCode = yield countryHelper.getCountryPhoneCodeByShortCode('US'); | ||
console.log(phoneCode); | ||
}))(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
"author": "Isaiah Clifford Opoku <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/frankodoom/CountryData.Net" | ||
"url": "https://github.com/Clifftech123/CountryData.js" | ||
}, | ||
"files": [ | ||
"dist", | ||
|