normalizer
This is a normal normalizer. The module is a function that takes 4 arguments:
- min value of set
- max value of set
- min normalized value
- max normalized value
The last two are optional, and wil default to 0 and 1 respectively.
It returns a function that takes a single param, a value from the given set
npm install normalizer
usage
var normr = ;var set = 1234 2345 3456 4567var normalize = forvar t = 0; t < setlength; t++ console;
What we have done here is created a function that will normalize the values in set to values between zero and one. One need not use a set, but simply set a min and max, and pass values to the returned function. Of course, if you pass value that is outside of the min/max, you will get a normalized value outside of the normalized min/max.
If you want to normalize a set, use normalize-set
There is yet another take on normalization for durations of time, in normalize-time
test
to run the tests:
npm install tape
node test.js