-
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.
docs: Update README.md and add TypeScript sample
- Update README.md to include a note about compiling TypeScript files before running the code. - Add a new TypeScript sample file to the Sample directory. Refactor: Update package.json repository URL - Update the repository URL in package.json to point to the correct GitHub repository.
- Loading branch information
1 parent
47916f4
commit b17a732
Showing
3 changed files
with
51 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
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 |
---|---|---|
|
@@ -28,7 +28,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", | ||
|