# change-maker

> An implementation of the change-making problem

Latest version **1.2.0** (published 2016-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install change-maker
pnpm add change-maker
yarn add change-maker
bun add change-maker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-04-01 |
| First published | 2016-02-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >5.6.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joe Pettersson |
| Maintainers | joe8bit |
| Keywords | change, algorithm, change making problem, knapsack problem |

## Links

- npm: https://www.npmjs.com/package/change-maker
- Repository: https://github.com/Joe8Bit/change-maker
- Homepage: https://github.com/Joe8Bit/change-maker#readme
- Issues: https://github.com/Joe8Bit/change-maker/issues
- npm.io page: https://npm.io/package/change-maker

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.5.1
- [accounting](https://npm.io/package/accounting.md) ^0.4.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2016-04-01
- 1.1.0 — 2016-02-29
- 1.0.0 — 2016-02-29

## README

## change-maker


[![Circle CI](https://circleci.com/gh/Joe8Bit/change-maker.svg?style=svg)](https://circleci.com/gh/Joe8Bit/change-maker)

[![Coverage Status](https://coveralls.io/repos/github/Joe8Bit/change-maker/badge.svg?branch=master)](https://coveralls.io/github/Joe8Bit/change-maker?branch=master)
[![Dependency status](https://david-dm.org/joe8bit/change-maker.svg)](https://david-dm.org/Joe8bit/change-maker)
[![Dependency status](https://david-dm.org/Joe8bit/change-maker/dev-status.svg)](https://david-dm.org/Joe8bit/change-maker#info=devDependencies&view=table)
[![npm version](https://badge.fury.io/js/change-maker.svg)](https://badge.fury.io/js/change-maker)
[![Known Vulnerabilities](https://snyk.io/test/npm/change-maker/badge.svg)](https://snyk.io/test/npm/change-maker)

Change Maker is a simple general purpose implementation of the '[change making](https://en.wikipedia.org/wiki/Change-making_problem)' problem, this module has been created to talk candidates through a greedy (but memoised and sideffectless) implementation of this classic [knapsack problem](https://en.wikipedia.org/wiki/Knapsack_problem).

## Usage

```
npm install change-maker
```

```javascript
const makeChange = require('change-maker');

// Where the first argument is a string representing the amount and the second is the array of coin denominations
const change = makeChange('$2.34', [100, 50, 25, 10, 5, 1]); // { '100': 2, '50': 0, '25': 1, '10': 0, '5': 1, '1': 4 }
```

## Testing

```
npm test
npm coverage // runs tests and generates coverage report
```

## Contrubuting

All contributors will abide by the `CODE_OF_CONDUCT.md`.

## License

MIT

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