Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/src/utility.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.22/src/utility.ts";

Lazily produce a range of numbers.

There are two forms:

  • from/to/step: to is exclusive, and
  • from/until/step: until is inclusive.

Example

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

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