# money

> JavaScript currency conversion library.

Latest version **0.2.0** (published 2014-07-16) · 0 weekly downloads

## Install

```sh
npm install money
pnpm add money
yarn add money
bun add money
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2014-07-16 |
| First published | 2011-10-13 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/money) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1473 |
| Author | Open Exchange Rates |
| Maintainers | joss |
| Keywords | money, fx, currency, convert, conversion, exchange, rate, utilities, accounting, number, cart, ecommerce |

## Links

- npm: https://www.npmjs.com/package/money
- Repository: https://github.com/openexchangerates/money.js
- Homepage: http://openexchangerates.github.io/money.js
- Issues: https://github.com/openexchangerates/money.js/issues
- npm.io page: https://npm.io/package/money

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2014-07-16
- 0.1.3 — 2012-01-28
- 0.1.2 — 2012-01-28
- 0.0.1 — 2011-10-13

## README

# money.js / fx() 

Simple and tiny JavaScript library for realtime currency conversion and exchange rate calculation, from any currency, to any currency. 

**money.js** is lightweight, has no dependencies, and works great client-side or server-side. Use standalone or as a nodeJS/npm and AMD/requireJS module.

Designed for seamless integration with the **[Open Exchange Rates API](https://openexchangerates.org "Free reliable exchange rates/currency conversion data API")**, but can be integrated with any source of currency data or with static/cached/approximate exchange rates.

Visit the plugin homepage for demos and documentation: **http://openexchangerates.github.io/money.js/**


## Quick Examples:

```javascript
// Simple syntax:
fx.convert(1000, {from: "GBP", to: "HKD"});

// Method chaining:
fx(1.99).from("USD").to("AED");

// Basic parsing:
fx("$1.99 HKD").to("EUR");

// Default parameters:
fx(5318008).convert();

// Supports nodeJS / AMD:
var fx = require('money');
require(["money"], function(fx) { /* ... */ });
```

## Changelog

**0.2**
* Now maintained by Open Exchange Rates
* Improved documentation

**0.1.3** - Fixed typo in nodeJS module definition

**0.1.2** - Strengthened up module definition similar to accounting.js

**0.1.1** - Added fallback when base rate is not in rates object (e.g. `"USD": 1`) to avoid errors

**0.1.0** - Added license; bumped version

**0.0.2**
* Adds basic parsing to `fx()`, so that you can pass a formatted string, like so: `fx("$1.99 HKD").to("GBP")`
* Some cleanup and improved comments and docs

**0.0.1** - First release

---
_Source: https://npm.io/package/money · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
