0.0.11 • Published 6 years ago

most-range v0.0.11

Weekly downloads
1
License
BSD-3-Clause
Repository
github
Last release
6 years ago

most-range

Version License

Creates a most.js stream of numbers (positive and/or negative) progressing from start up, or down, to, but not including, end.

Installation

Using npm:

$ npm install --save most-range

In Node.js:

const range = require('most-range');

Usage

range(start, end [, step = 1 or -1]) -> Stream

range(0, 10, 2): -0-2-4-6-8-|
  • start is the start of the range.
  • end is the end of the range, its value is excluded.
  • step is the value to increment or decrement by, the default is 1 if end is greater than start, -1 otherwise.

Example

const range = require('most-range');

// Logs
// 10
// 7
// 4
// 1
range(10, 0, -3)
  .observe(x => console.log(x))