normalize-to-range
Normalize an array of numbers or object property values to a specified range.
Installation
$ npm install normalize-to-range
Usage
;
Array of numbers:
;// [0, 30, 210, 270, 300]
Array of objects:
;// [{ height: 300 }, { height: 1000 }]
By default normalizes between 0 and 1:
;// [0, 0.1, 0.6, 1]
Standalone
Generate a standalone build in dist
(for use with <script>
tags and AMD module loaders):
$ npm run build:standalone
Test
Tests are done with tape by running:
$ npm test