Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
world-countries-capitals
Advanced tools
A simple NPM package to get capitals, currency, native language, famous_for etc. of all the countries in the world
This is a Node.js module available through the npm registry.
Before using, download and install Node.js.
Installation is done using the
npm install
command:
$ npm i world-countries-capitals --save
const wcc = require("world-countries-capitals");
[
{
"country": "afghanistan",
"capital": "kabul",
"currency": "afghani",
"native_language": ["dari persian", "pashto"],
"famous_for": "rugs, taliban"
},
{
"country": "albania",
"capital": "tirane",
"currency": "lek",
"native_language": ["albanian"],
"famous_for" : "mother teresa"
},
...
]
[
'afghanistan',
'albania',
'algeria',
'andorra',
'angola',
'antigua & Barbuda',
'argentina',
'armenia',
'australia',
'austria',
'azerbaijan',
...
]
Response for languageSpoken = 'Hindi'
[
{
{
country: "fiji",
capital: "suva",
currency: "fijian dollar",
native_language: ["english", "bau fijian", "hindi"],
famous_for: "friendly people and heavenly tropical islands"
},
{
country: "india",
capital: "new delhi",
currency: "indian rupee",
native_language: ["hindi", "english"],
famous_for: "bollywood, yoga, hinduism, food and diversity"
}
];
Response for countryName = 'india'
[
{
country: "india",
capital: "new delhi",
currency: "indian rupee",
native_language: ["hindi", "english"],
famous_for: "bollywood, yoga, hinduism, food and diversity"
}
];
Response for capital = 'delhi'
[
{
country: "india",
capital: "new delhi",
currency: "indian rupee",
native_language: ["hindi", "english"],
famous_for: "bollywood, yoga, hinduism, food and diversity"
}
];
» node app.js
tuvalu
» node app.js
bhutan
» node app.js
saudi arabia
Response for n = 3
[
{
country: "burundi",
capital: "bujumbura",
currency: "burundi franc",
native_language: ["kirundi", "french"],
famous_for: "wildlife and greenery"
},
{
country: "palau",
capital: "melekeok",
currency: "united states dollar",
native_language: ["english", "palauan"],
famous_for: "jellyfish lake",
},
{
country: "dominican republic",
capital: "santo domingo",
currency: "dominican peso",
native_language: ["spanish"],
famous_for: "blue ocean water, white-sand beaches and beautiful resorts"
}
];
const wcc = require("world-countries-capitals");
console.log(wcc.getRandomCountry());
const wcc = require("world-countries-capitals");
console.log(wcc.getNRandomCountriesData(3));
const wcc = require("world-countries-capitals");
console.log(wcc.getCountryDetailsByCapital("delhi"));
const wcc = require("world-countries-capitals");
console.log(wcc.getCountryDetailsByName("India"));
const wcc = require("world-countries-capitals");
console.log(wcc.getCountiesByLanguage("hindi"));
const wcc = require("world-countries-capitals");
console.log(wcc.getAllCountryDetails());
const wcc = require("world-countries-capitals");
console.log(wcc.getAllCountries());
Please check issues here!
1.5.1 (February 18, 2020)
FAQs
A simple NPM package to get capitals, currency, native language, famous_for etc. of all the countries in the world
The npm package world-countries-capitals receives a total of 578 weekly downloads. As such, world-countries-capitals popularity was classified as not popular.
We found that world-countries-capitals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.