Skip to main content
Module

x/proc/mod3.ts>range

A high-level way to run child processes that is easy, flexible, powerful, and prevents resource leaks.
Go to Latest
function range
import { range } from "https://deno.land/x/proc@0.20.11/mod3.ts";

Lazily produce a range of numbers.

There are two forms:

  • from/to/step: default 0 based, to is exclusive, and
  • from/until/step: default 1 based, until is inclusive.

Example

const result = await range({to: 10}).collect();

// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]