# nylira-normalize

> Normalize an array of numbers to 0..max

Latest version **0.2.0** (published 2015-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install nylira-normalize
pnpm add nylira-normalize
yarn add nylira-normalize
bun add nylira-normalize
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-03-31 |
| First published | 2015-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Peng Zhong |
| Maintainers | nylira |
| Keywords | normalize, array, numbers |

## Links

- npm: https://www.npmjs.com/package/nylira-normalize
- Repository: git@github.com:nylira/nylira-normalize
- Homepage: https://github.com/nylira/nylira-normalize
- Issues: https://github.com/nylira/nylira-normalize/issues
- npm.io page: https://npm.io/package/nylira-normalize

## 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) — 2015-03-31
- 0.1.4 — 2015-03-15
- 1.0.3 — 2015-03-15
- 1.0.2 — 2015-03-15
- 1.0.1 — 2015-03-15
- 1.0.0 — 2015-03-15

## README

# nylira-normalize

Normalize an array of numbers to the range [min..max]

## Install

    npm install nylira-normalize

# Use it
    
    var normalize = require('nylira-normalize')
    var numbers = [-20, -10, 0, 10, 20]

    // normalize the numbers to [0..1]
    normalize(numbers)

    // output:
    // [0.2, 0.4, 0.6, 0.8, 1]

    // normalize the numbers to [0..60]
    normalize(numbers, 0, 60)

    // output:
    // [0, 15, 30, 45, 60]

# Test

    npm test

    // console output:
    normalize([-20,-10,0,10,20])                 = [ 0, 0.25, 0.5, 0.75, 1 ]
    normalize([-20,-10,0,10,20], 0, 60)          = [ 0, 15, 30, 45, 60 ]
    normalize([-20,-10,0,10,20], -1, 1)          = [ -1, -0.5, 0, 0.5, 1 ]
    normalize([-20,-10,0,10,20], -60, 120)       = [ -60, -15, 30, 75, 120 ]
    normalize([0,12,43,77,100], -4.1, 97)        = [ -4.1, 8.032, 39.373, 73.747, 97 ]
    normalize([1, 2, 3, 4, 5], -1, 1)            = [ -1, -0.5, 0, 0.5, 1 ]
    normalize([1, 2, 3, 4, 5], -1, 1)            = [ -1, -0.5, 0, 0.5, 1 ]
    normalize([1.3, 2.3, 3.3, 4.3, 5.3], -7, -1) = [ -7, -5.5, -4, -2.5, -1 ]

# License

MIT

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