3.0.0 • Published 5 years ago

callbag-range v3.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

callbag-range

Callbag source that creates a range of numbers from: number (inclusive) to: number (inclusive). An optional step can be passed as 3rd argument (1 by default).

npm install callbag-range

Examples

Generate the English alphabet

const { forEach, map, pipe } = require('callbag-basics');
const range = require('callbag-range');

pipe(
  range(97, 122),
  map(String.fromCharCode),
  forEach((v) => {
    console.log(v); // a, b, c, ..., z
  })
);

Decreasing range from 10 to 0

const { forEach, pipe } = require('callbag-basics');
const range = require('callbag-range');

pipe(
  range(10, 0, -1),
  forEach((v) => {
    console.log(v); // 10, 9, 8, ..., 0
  })
);
3.0.0

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago