
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
country-codes-list
Advanced tools
List of codes per country (languages, calling codes, currency codes, etc) with full TypeScript support.
Module with list of codes per country, including country codes, currency codes, and more.
[!WARNING]
Release v2.0.0 introduces breaking changes with full TypeScript support and automated testing/publishing.
Install the package via npm:
npm install --save country-codes-list
To compile the package, run:
npm run build
The compiled output will be in the dist/
folder.
To run tests:
npm test
npm install --save country-codes-list
TypeScript Types: If you were using types:
// Old (v1.x)
import { CountryProperty } from "country-codes-list";
const prop: CountryProperty = CountryProperty.countryCode;
// New (v2.0)
import type { CountryProperty } from "country-codes-list";
const prop: CountryProperty = "countryCode";
Module Imports: Now supports both CommonJS and ES modules:
// CommonJS (still works)
const countryCodes = require("country-codes-list");
// ES Modules (new)
import * as countryCodes from "country-codes-list";
Stricter Types: Some functions now have stricter type checking:
// This now requires valid country property keys
countryCodes.filter("invalidKey", "value"); // TypeScript error
This package can be used in both CommonJS (JavaScript) and TypeScript environments.
const countryCodes = require("country-codes-list");
const myCountryCodesObject = countryCodes.customList(
"countryCode",
"[{countryCode}] {countryNameEn}: +{countryCallingCode}"
);
console.log(myCountryCodesObject);
import * as countryCodes from "country-codes-list";
const myCountryCodesObject = countryCodes.customList(
"countryCode",
"[{countryCode}] {countryNameEn}: +{countryCallingCode}"
);
console.log(myCountryCodesObject);
{placeholder}
format) replaced by corresponding country properties.The available placeholders are:
countryNameEn
countryNameLocal
countryCode
currencyCode
currencyNameEn
tinType
tinName
officialLanguageCode
officialLanguageNameEn
officialLanguageNameLocal
countryCallingCode
region
globalSouth
const countryCodes = require("country-codes-list");
const myCountryCodesObject = countryCodes.customList(
"countryCode",
"[{countryCode}] {countryNameEn}: +{countryCallingCode}"
);
This will return an object like this one:
{
'AD': '[AD] Andorra: +376',
'AE': '[AE] United Arab Emirates: +971',
'AF': '[AF] Afghanistan: +93',
'AG': '[AG] Antigua and Barbuda: +1',
'AI': '[AI] Anguilla: +1',
'AL': '[AL] Albania: +355',
'AM': '[AM] Armenia: +374',
'AO': '[AO] Angola: +244',
'AQ': '[AQ] Antarctica: +',
'AR': '[AR] Argentina: +54',
'AS': '[AS] American Samoa: +1',
'AT': '[AT] Austria: +43',
'AU': '[AU] Australia: +61',
'AW': '[AW] Aruba: +297',
...
}
FAQs
List of codes per country (languages, calling codes, currency codes, etc) with full TypeScript support.
The npm package country-codes-list receives a total of 63,095 weekly downloads. As such, country-codes-list popularity was classified as popular.
We found that country-codes-list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.