
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
parity-factor
Advanced tools
A Node.js package to fetch and calculate Purchasing Power Parity (PPP) conversion factors (GDP, LCU per international dollar) for any country using World Bank, Eurostat, and OECD data.
A lightweight Node.js package and CLI tool to fetch real-time Purchasing Power Parity (PPP) conversion factors (GDP-based, LCU per international $).
Data is sourced from the World Bank and cached via CDN + fallback JSON for reliability.
☕ This package runs on caffeine. If it helped you, consider buying me a coffee.
npm install parity-factor
Or with yarn:
yarn add parity-factor
import { getParity } from "ppp-conversion";
const value = await getParity("AFG");
console.log("PPP for Afghanistan:", value);
Output:
{
"last_updated": "2025-08-18",
"data": [
{
"sourceid": "2",
"indicator": {
"id": "PA.NUS.PPP",
"value": "PPP conversion factor, GDP (LCU per international $)"
},
"country": {
"id": "AF",
"value": "Afghanistan"
},
"countryiso3code": "AFG",
"date": "2023",
"value": 14.8009414284672,
"unit": "",
"obs_status": "",
"decimal": 2
}
]
}
npx parityfactor AFG
Output:
{
"sourceid": "2",
"indicator": {
"id": "PA.NUS.PPP",
"value": "PPP conversion factor, GDP (LCU per international $)"
},
"country": {
"id": "AF",
"value": "Afghanistan"
},
"countryiso3code": "AFG",
"date": "2023",
"value": 14.8009414284672,
"unit": "",
"obs_status": "",
"decimal": 2
}
This package provides support for the following countries. Each entry contains the ISO Alpha-3 country code and the country name.
Code | Country |
---|---|
AFG | Afghanistan |
ALB | Albania |
DZA | Algeria |
AND | Andorra |
AGO | Angola |
ATG | Antigua and Barbuda |
ARG | Argentina |
ARM | Armenia |
ABW | Aruba |
AUS | Australia |
AUT | Austria |
AZE | Azerbaijan |
BHS | Bahamas, The |
BHR | Bahrain |
BGD | Bangladesh |
BRB | Barbados |
BLR | Belarus |
BEL | Belgium |
BLZ | Belize |
BEN | Benin |
BMU | Bermuda |
BTN | Bhutan |
BOL | Bolivia |
BIH | Bosnia and Herzegovina |
BWA | Botswana |
BRA | Brazil |
BRN | Brunei Darussalam |
BGR | Bulgaria |
BFA | Burkina Faso |
BDI | Burundi |
CPV | Cabo Verde |
KHM | Cambodia |
CMR | Cameroon |
CAN | Canada |
CAF | Central African Republic |
TCD | Chad |
CHL | Chile |
CHN | China |
COL | Colombia |
COM | Comoros |
COD | Congo, Dem. Rep. |
COG | Congo, Rep. |
CRI | Costa Rica |
CIV | Cote d'Ivoire |
HRV | Croatia |
CUW | Curacao |
CYP | Cyprus |
CZE | Czechia |
DNK | Denmark |
DJI | Djibouti |
DMA | Dominica |
DOM | Dominican Republic |
ECU | Ecuador |
EGY | Egypt, Arab Rep. |
SLV | El Salvador |
GNQ | Equatorial Guinea |
ERI | Eritrea |
EST | Estonia |
SWZ | Eswatini |
ETH | Ethiopia |
FJI | Fiji |
FIN | Finland |
FRA | France |
GAB | Gabon |
GMB | Gambia, The |
GEO | Georgia |
DEU | Germany |
GHA | Ghana |
GRC | Greece |
GRL | Greenland |
GRD | Grenada |
GTM | Guatemala |
GIN | Guinea |
GNB | Guinea-Bissau |
GUY | Guyana |
HTI | Haiti |
HND | Honduras |
HKG | Hong Kong SAR, China |
HUN | Hungary |
ISL | Iceland |
IND | India |
IDN | Indonesia |
IRN | Iran, Islamic Rep. |
IRQ | Iraq |
IRL | Ireland |
ISR | Israel |
ITA | Italy |
JAM | Jamaica |
JPN | Japan |
JOR | Jordan |
KAZ | Kazakhstan |
KEN | Kenya |
KIR | Kiribati |
KOR | Korea, Rep. |
XKX | Kosovo |
KWT | Kuwait |
KGZ | Kyrgyz Republic |
LAO | Lao PDR |
LVA | Latvia |
LBN | Lebanon |
LSO | Lesotho |
LBR | Liberia |
LBY | Libya |
LTU | Lithuania |
LUX | Luxembourg |
MAC | Macao SAR, China |
MDG | Madagascar |
MWI | Malawi |
MYS | Malaysia |
MDV | Maldives |
MLI | Mali |
MLT | Malta |
MHL | Marshall Islands |
MRT | Mauritania |
MUS | Mauritius |
MEX | Mexico |
FSM | Micronesia, Fed. Sts. |
MDA | Moldova |
MNG | Mongolia |
MNE | Montenegro |
MAR | Morocco |
MOZ | Mozambique |
MMR | Myanmar |
NAM | Namibia |
NRU | Nauru |
NPL | Nepal |
NLD | Netherlands |
NZL | New Zealand |
NIC | Nicaragua |
NER | Niger |
NGA | Nigeria |
MKD | North Macedonia |
NOR | Norway |
OMN | Oman |
PAK | Pakistan |
PLW | Palau |
PAN | Panama |
PNG | Papua New Guinea |
PRY | Paraguay |
PER | Peru |
PHL | Philippines |
POL | Poland |
PRT | Portugal |
PRI | Puerto Rico (US) |
QAT | Qatar |
ROU | Romania |
RUS | Russian Federation |
RWA | Rwanda |
WSM | Samoa |
STP | Sao Tome and Principe |
SAU | Saudi Arabia |
SEN | Senegal |
SRB | Serbia |
SYC | Seychelles |
SLE | Sierra Leone |
SGP | Singapore |
SVK | Slovak Republic |
SVN | Slovenia |
SLB | Solomon Islands |
SOM | Somalia |
ZAF | South Africa |
ESP | Spain |
LKA | Sri Lanka |
KNA | St. Kitts and Nevis |
LCA | St. Lucia |
VCT | St. Vincent and the Grenadines |
SDN | Sudan |
SUR | Suriname |
SWE | Sweden |
CHE | Switzerland |
SYR | Syrian Arab Republic |
TJK | Tajikistan |
TZA | Tanzania |
THA | Thailand |
TLS | Timor-Leste |
TGO | Togo |
TON | Tonga |
TTO | Trinidad and Tobago |
TUN | Tunisia |
TUR | Turkiye |
TKM | Turkmenistan |
TCA | Turks and Caicos Islands |
TUV | Tuvalu |
UGA | Uganda |
UKR | Ukraine |
ARE | United Arab Emirates |
GBR | United Kingdom |
USA | United States |
URY | Uruguay |
UZB | Uzbekistan |
VUT | Vanuatu |
VNM | Viet Nam |
PSE | West Bank and Gaza |
YEM | Yemen, Rep. |
ZMB | Zambia |
ZWE | Zimbabwe |
✅ Total Supported Countries: 191
All parity conversion factors are updated monthly and served from CDN:
👉 https://cdn.jsdelivr.net/npm/parity-factor@latest/v1/parity.json
ISC – © Jayadev Panthaplavil
FAQs
A Node.js package to fetch and calculate Purchasing Power Parity (PPP) conversion factors (GDP, LCU per international dollar) for any country using World Bank, Eurostat, and OECD data.
We found that parity-factor demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.