PPP (Purchasing Power Parity)
A simple, lightweight, and dependency-free NPM package to calculate Purchasing Power Parity (PPP) adjusted fair prices in USD. This package allows you to calculate what a “fair” price would be in different countries, based on the Price Level Ratio of PPP conversion factor to market exchange rate from the World Bank.Why Parity Pricing?
Charging the same USD price globally ignores the vast differences in purchasing power:- $10 in the US is a cheap lunch
- $10 in a developing nation might be a day’s wage
Installation
Get started by installing the package via npm, yarn, or pnpm
Quickstart
Calculate your first PPP-adjusted price in minutes
API Reference
Explore the full API documentation and parameters
Examples
See real-world use cases and implementation patterns
Key Features
Zero Dependencies
Lightweight package with no runtime dependencies for your application
World Bank Data
Uses official Price Level Ratio data from World Bank indicator PA.NUS.PPPC.RF
Flexible Rounding
Choose from precision, currency, or marketing-friendly rounding strategies
TypeScript Support
Fully typed with TypeScript definitions included
ISO Country Codes
Supports both 2-letter and 3-letter country codes
Smoothing Control
Adjust the discount level from raw PPP to original pricing
Quick Example
Calculate a fair price for a $10 product in Sri Lanka:The package uses the World Bank’s Price Level Ratio (indicator:
PA.NUS.PPPC.RF) to determine fair pricing across 200+ countries.How It Works
The library calculates adjusted prices using the formula:- Ratio: The Price Level Ratio for the country (~0.29 for Sri Lanka, ~1.0 for USA)
- Smoothing: A value between 0 and 1 to control the discount level (default: 0.2)