most-range
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

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

Package Sidebar

Install

npm i most-range

Weekly Downloads

2

Version

0.0.11

License

BSD-3-Clause

Unpacked Size

2.76 kB

Total Files

5

Last publish

Collaborators

  • craft-ai