Skip to main content

Installation

The @sachithrrra/ppp package is available on NPM and can be installed using your preferred package manager.

Prerequisites

This package is designed for Node.js environments and supports ES modules. Make sure your project is configured to use ES modules.
  • Node.js 14.0 or higher recommended
  • ES module support ("type": "module" in your package.json)

Package Managers

Choose your preferred package manager to install the PPP package:
npm install @sachithrrra/ppp

Package Information

The package includes:
  • Main module: ES module export (index.js)
  • TypeScript definitions: Full type support included (index.d.ts)
  • PPP data: Pre-bundled World Bank Price Level Ratios for 200+ countries
  • Zero runtime dependencies: No additional packages required in production
While the package has zero runtime dependencies, development dependencies are only used for data updates and testing. Your application bundle stays lightweight.

Verify Installation

After installation, verify the package is working correctly:
1

Create a test file

Create a new file called test-ppp.js in your project:
test-ppp.js
import ppp from '@sachithrrra/ppp';

console.log(ppp(10, 'US'));
2

Run the test

Execute the test file:
node test-ppp.js
3

Check the output

You should see a number close to 10 (around 9.8-10.2), since the USA has a Price Level Ratio near 1.0.

TypeScript Setup

If you’re using TypeScript, the package includes full type definitions out of the box:
import ppp, { RoundingStrategy } from '@sachithrrra/ppp';

// TypeScript will validate your parameters
const price: number | null = ppp(29.99, 'IN', 0.2, 'currency');

// Type-safe rounding strategy
const strategy: RoundingStrategy = 'pretty';
const prettyPrice = ppp(49.99, 'BR', 0.3, strategy);
No additional @types package is needed. Type definitions are included with the main package.

Next Steps

Now that you’ve installed the package, you’re ready to start calculating PPP-adjusted prices:

Quickstart Guide

Learn how to calculate your first PPP-adjusted price

API Reference

Explore all available functions and parameters

Build docs developers (and LLMs) love