# @teselagen/range-utils

Latest version **0.3.20** (published 2026-01-05) · 0 weekly downloads

## Install

```sh
npm install @teselagen/range-utils
pnpm add @teselagen/range-utils
yarn add @teselagen/range-utils
bun add @teselagen/range-utils
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.20 |
| Published | 2026-01-05 |
| First published | 2023-05-30 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 393.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 106 |
| Maintainers | teselagen-admin, tnrich, colincwilson, andres-teselagen, tgreen-teselagen |

## Links

- npm: https://www.npmjs.com/package/@teselagen/range-utils
- Repository: https://github.com/TeselaGen/tg-oss
- Homepage: https://github.com/TeselaGen/tg-oss#readme
- Issues: https://github.com/TeselaGen/tg-oss/issues
- npm.io page: https://npm.io/package/@teselagen/range-utils

## Dependencies (1)

- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21

## Recent versions

- 0.3.20 (latest) — 2026-01-05
- 0.3.20-beta.2 (beta) — 2026-01-22
- 0.1.11 (undefined) — 2023-06-07
- 0.3.20-beta.1 — 2026-01-21
- 0.3.19 — 2026-01-05
- 0.3.18 — 2026-01-05
- 0.5.0-beta.0 — 2026-01-02
- 0.5.0 — 2026-01-02
- 0.3.14-beta.3 — 2025-12-16
- 0.3.14-beta.2 — 2025-12-16
- 0.3.14-beta.1 — 2025-06-10
- 0.3.13 — 2025-02-24
- 0.3.12 — 2025-02-24
- 0.3.11 — 2025-02-24
- 0.3.10 — 2025-01-28
- … 26 more at https://npm.io/package/@teselagen/range-utils/versions

## README

<!-- TOC -->

- [[CHANGELOG](Changelog.md)](#changelogchangelogmd)
- [Installing](#installing)
- [Usage](#usage)
- [About this Repo](#about-this-repo)
- [Editing This Repo:](#editing-this-repo)
  - [All collaborators:](#all-collaborators)
- [Updating this repo:](#updating-this-repo)
  - [Teselagen collaborators:](#teselagen-collaborators)
  - [Outside collaborators:](#outside-collaborators)
- [Building](#building)
- [Running unit tests](#running-unit-tests)

<!-- /TOC -->

## [CHANGELOG](Changelog.md)

## Installing

```
npm install @teselagen/range-utils
```

## Usage

```
import { getRangeLength } from '@teselagen/range-utils';
```

## About this Repo

This is a collection of range utility functions.

A range must be an object with a start and end property.
Eg:

```
const myRange = {
	start: 10,
	end: 40
}
```

A "circular" range has a start > end.
Eg:

```
const myRange2 = {
	start: 50,
	end: 40
}
```

All ranges are assumed to have 0-based inclusive indices:

rrrr
0123
start = 0,
end = 3

## Editing This Repo:

### All collaborators:

Edit/create a new file and update/add any relevant tests.
You can run `npm test` to make sure all tests pass.
Tests will automatically be run pre-commit.

## Updating this repo:

### Outside collaborators:

fork and pull request please :)

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build range-utils` to build the library.

## Running unit tests

Run `nx test range-utils` to execute the unit tests via [Jest](https://jestjs.io).

---
_Source: https://npm.io/package/@teselagen/range-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
