callbag-range

3.0.0 • Public • Published

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
  })
);

Readme

Keywords

Package Sidebar

Install

npm i callbag-range

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

6.28 kB

Total Files

6

Last publish

Collaborators

  • francisco.tln