adder

interpolating adder

npm install adder
18 downloads in the last day
59 downloads in the last week
231 downloads in the last month

Adder will create an array of steps at regular intervals.

var adder = require('adder');

// basic use: adder(start, end, steps)
var steps = adder(10, 100, 10);
steps == [ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]

// figures it out if the numbers are too small
var steps = adder(1, 2.5, 6);
steps == [ 1, 1.3, 1.6, 1.9, 2.2, 2.5 ]

// works in reverse and with negative numbers
var steps = adder(10, -10, 5);
steps == [ 10, 5, 0, -5, -10 ]

Entire file is under 10 lines of code.

fire

MIT license.

npm loves you