Skip to content
šŸ’« Make your products affordable for everyone around the world.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Update freegeoip url Oct 29, 2018
.babelrc change imports exports Oct 30, 2017
.gitignore compile before publish Oct 29, 2017
.npmignore compile before publish Oct 29, 2017
.travis.yml add travis build Dec 28, 2017
LICENSE Create LICENSE Apr 27, 2018
README.md update README.md Jun 9, 2018
package-lock.json adjust package.json Nov 2, 2017
package.json Bump version due to npm mistake Nov 1, 2018

README.md

Purchasing Power Parity

Build Status

Not everyone is able to pay for the default pricings of the western world. Online products should be made affordable for everyone around the world. This package is a simple way to make Purchasing Power Parity available in your browser. See how it could look like in your application for someone buying your product from another country:

screen shot 2017-11-02 at 08 40 54

How to use it?

Install:

npm install purchasing-power-parity

Use:

import getPpp from 'purchasing-power-parity';

let originalPrice = 99.99;
let discountPrice;

getPpp(OPEN_EXCHANGE_RATES_API_KEY, QUANDL_API_KEY).then((ppp) => {
  discountPrice = ppp.pppConversionFactor * originalPrice;
});

So you can adjust your prices when the pppConversionFactor goes below 1 and add an optional banner for your customers to make them aware of it. What other information is in the returned PPP object?

ppp-object:

{
  countryCodeIsoAlpha2: "IN",
  countryCodeIsoAlpha3: "IND",
  countryName: "India",
  currenciesCountry: [{
    code: "INR",
    name: "Indian rupee",
    symbol: "ā‚¹"
  }],
  currencyMain: {
    exchangeRate: 65.06,
    code: "INR",
    name: "Indian rupee",
    symbol: "ā‚¹"
  },
  ppp: 17.536,
  pppConversionFactor: 0.2695358130956041,
}

The currencyMain property with its exchangeRate property is used to compute the pppConversionFactor by using the ppp.

Limitations

  • runs only in the browser
  • takes only USD as baseline

Who uses PPP?

This node package was inspired by Wesbos who sells his courses with PPP. There are other people which make their products affordable to everyone around the world by using PPP. You can add your project/company/product/service/... to the list when you are using this package:

Contribution

The project is in an early stage, so please feel free to contribute to it. It works, but it could be more robust and improved. If you want to know how PPP works, you can read up this short article. I would love to see you contributing to it:

  • create an Issue
  • discuss with maintainers and contributors about the issue
  • create a Pull Request if the issue should be solved
You canā€™t perform that action at this time.