# list-range

> Return an array of values within range, determined by range(start, stop[, step])

Latest version **1.0.6** (published 2017-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install list-range
pnpm add list-range
yarn add list-range
bun add list-range
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2017-07-31 |
| First published | 2017-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Nicolás Quiroz |
| Maintainers | nhsz |
| Keywords | array, list, fill, range, es6, python, expand, expansion |

## Links

- npm: https://www.npmjs.com/package/list-range
- Repository: https://github.com/nhsz/list-range
- Homepage: https://github.com/nhsz/list-range#readme
- Issues: https://github.com/nhsz/list-range/issues
- npm.io page: https://npm.io/package/list-range

## Recent versions

- 1.0.6 (latest) — 2017-07-31
- 1.0.5 — 2017-06-14
- 1.0.4 — 2017-06-11
- 1.0.2 — 2017-06-11
- 1.0.1 — 2017-06-11
- 1.0.0 — 2017-06-11

## README

# list-range

> Return an array of values within range, determined by `range(start, stop[, step])`  
ES6 implementation of **[`Python built-in range()`](https://docs.python.org/3.6/library/stdtypes.html#range)** function

[![Build Status](https://travis-ci.org/nhsz/list-range.svg?branch=master)](https://travis-ci.org/nhsz/list-range)
[![Coverage Status](https://coveralls.io/repos/github/nhsz/list-range/badge.svg?branch=master)](https://coveralls.io/github/nhsz/list-range?branch=master)
[![Codebeat badge](https://codebeat.co/badges/90d7c473-974f-45d6-b62c-3415e6da8b0d)](https://codebeat.co/projects/github-com-nhsz-list-range-master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/330539c9950446358587769371f0cdd9)](https://www.codacy.com/app/nquiroz/list-range?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=nhsz/list-range&amp;utm_campaign=Badge_Grade)
[![Code Climate](https://codeclimate.com/github/nhsz/list-range/badges/gpa.svg)](https://codeclimate.com/github/nhsz/list-range)

[![NPM](https://nodei.co/npm/list-range.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/list-range/)

## Features

- ES6
- Zero dependencies
- 100% test code coverage

## Rules

- `start` and `step` are optional
- If the `step` argument is omitted, it defaults to 1
- If the `start` argument is omitted, it defaults to 0
- All the arguments must be integers
- `step` can not be 0

## Install

```
$ npm install list-range
```

## Usage

```js
const range = require('list-range')

console.log(range(10))
// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
console.log(range(10, 10))
// []
console.log(range(3, 17, -2))
// []
console.log(range(1, 11))
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(range(0, 30, 5))
// [0, 5, 10, 15, 20, 25]
console.log(range(0, 10, 3))
// [0, 3, 6, 9]
console.log(range(10, -10, -1))
// [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
console.log(range(0))
// []
console.log(range(1, 0))
// []
console.log(range(21, -1, -2))
// [21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1]
console.log(range(-1, -5, 1))
// []
console.log(range(-1, -5))
// []
console.log(range(-1, -5, -1))
// [-1, -2, -3, -4]
console.log(range(1.2, 5.76))
// Error: All the arguments must be integers
console.log(range(1, 10, 0))
// Error: Step value can not be 0
```

## License

MIT © **[`Nicolás Quiroz`](https://nicolasquiroz.com)**

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