Socket
Book a DemoInstallSign in
Socket

parity-factor

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parity-factor

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.

latest
2025-9-6
Source
npmnpm
Version
2025.9.6
Version published
Maintainers
1
Created
Source

💸 parity-factor

Purchasing Power Parity (PPP) Conversion Factor

View on npm npm version npm downloads

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.

Buy Me A Coffee

✨ Features

  • Fetch PPP conversion factor by country ISO3 code.
  • Data refreshed daily via CDN
  • Works both as Node.js library and CLI tool
  • Simple, lightweight, no API key required 🚀
  • Unlimited data fetches

📦 Installation

npm install parity-factor

Or with yarn:

yarn add parity-factor

🚀 Usage

In Node.js

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
    }
  ]
}

In CLI

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
}

🌍 Supported Countries

This package provides support for the following countries. Each entry contains the ISO Alpha-3 country code and the country name.

📌 Countries List

Click to expand
CodeCountry
AFGAfghanistan
ALBAlbania
DZAAlgeria
ANDAndorra
AGOAngola
ATGAntigua and Barbuda
ARGArgentina
ARMArmenia
ABWAruba
AUSAustralia
AUTAustria
AZEAzerbaijan
BHSBahamas, The
BHRBahrain
BGDBangladesh
BRBBarbados
BLRBelarus
BELBelgium
BLZBelize
BENBenin
BMUBermuda
BTNBhutan
BOLBolivia
BIHBosnia and Herzegovina
BWABotswana
BRABrazil
BRNBrunei Darussalam
BGRBulgaria
BFABurkina Faso
BDIBurundi
CPVCabo Verde
KHMCambodia
CMRCameroon
CANCanada
CAFCentral African Republic
TCDChad
CHLChile
CHNChina
COLColombia
COMComoros
CODCongo, Dem. Rep.
COGCongo, Rep.
CRICosta Rica
CIVCote d'Ivoire
HRVCroatia
CUWCuracao
CYPCyprus
CZECzechia
DNKDenmark
DJIDjibouti
DMADominica
DOMDominican Republic
ECUEcuador
EGYEgypt, Arab Rep.
SLVEl Salvador
GNQEquatorial Guinea
ERIEritrea
ESTEstonia
SWZEswatini
ETHEthiopia
FJIFiji
FINFinland
FRAFrance
GABGabon
GMBGambia, The
GEOGeorgia
DEUGermany
GHAGhana
GRCGreece
GRLGreenland
GRDGrenada
GTMGuatemala
GINGuinea
GNBGuinea-Bissau
GUYGuyana
HTIHaiti
HNDHonduras
HKGHong Kong SAR, China
HUNHungary
ISLIceland
INDIndia
IDNIndonesia
IRNIran, Islamic Rep.
IRQIraq
IRLIreland
ISRIsrael
ITAItaly
JAMJamaica
JPNJapan
JORJordan
KAZKazakhstan
KENKenya
KIRKiribati
KORKorea, Rep.
XKXKosovo
KWTKuwait
KGZKyrgyz Republic
LAOLao PDR
LVALatvia
LBNLebanon
LSOLesotho
LBRLiberia
LBYLibya
LTULithuania
LUXLuxembourg
MACMacao SAR, China
MDGMadagascar
MWIMalawi
MYSMalaysia
MDVMaldives
MLIMali
MLTMalta
MHLMarshall Islands
MRTMauritania
MUSMauritius
MEXMexico
FSMMicronesia, Fed. Sts.
MDAMoldova
MNGMongolia
MNEMontenegro
MARMorocco
MOZMozambique
MMRMyanmar
NAMNamibia
NRUNauru
NPLNepal
NLDNetherlands
NZLNew Zealand
NICNicaragua
NERNiger
NGANigeria
MKDNorth Macedonia
NORNorway
OMNOman
PAKPakistan
PLWPalau
PANPanama
PNGPapua New Guinea
PRYParaguay
PERPeru
PHLPhilippines
POLPoland
PRTPortugal
PRIPuerto Rico (US)
QATQatar
ROURomania
RUSRussian Federation
RWARwanda
WSMSamoa
STPSao Tome and Principe
SAUSaudi Arabia
SENSenegal
SRBSerbia
SYCSeychelles
SLESierra Leone
SGPSingapore
SVKSlovak Republic
SVNSlovenia
SLBSolomon Islands
SOMSomalia
ZAFSouth Africa
ESPSpain
LKASri Lanka
KNASt. Kitts and Nevis
LCASt. Lucia
VCTSt. Vincent and the Grenadines
SDNSudan
SURSuriname
SWESweden
CHESwitzerland
SYRSyrian Arab Republic
TJKTajikistan
TZATanzania
THAThailand
TLSTimor-Leste
TGOTogo
TONTonga
TTOTrinidad and Tobago
TUNTunisia
TURTurkiye
TKMTurkmenistan
TCATurks and Caicos Islands
TUVTuvalu
UGAUganda
UKRUkraine
AREUnited Arab Emirates
GBRUnited Kingdom
USAUnited States
URYUruguay
UZBUzbekistan
VUTVanuatu
VNMViet Nam
PSEWest Bank and Gaza
YEMYemen, Rep.
ZMBZambia
ZWEZimbabwe

✅ Total Supported Countries: 191

🔗 Data Source

All parity conversion factors are updated monthly and served from CDN:
👉 https://cdn.jsdelivr.net/npm/parity-factor@latest/v1/parity.json

📜 License

ISC – © Jayadev Panthaplavil

Keywords

ppp

FAQs

Package last updated on 06 Sep 2025

Did you know?

Socket

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.

Install

Related posts