1.0.4 • Published 7 years ago

range-map v1.0.4

Weekly downloads
57
License
ISC
Repository
github
Last release
7 years ago

range-map

inspired by the Map function in Processing. This module scales a number from one range to another

Build Status codecov

Installation

$ npm install range-map

Example Usage

var rangeMap = require('range-map')

var mapped = rangeMap(50, 0, 100, 0, 1000)

//mapped == 500

API

mapped(input, inputLowest, inputHighest, outputLowest, outputHighest)

returns a number that has been rounded with Math.round() The ranges will also work with negative numbers.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago