# delta-list

> Data structure that maps an integer list to a list of relative integer deltas

Latest version **1.1.0** (published 2017-01-08) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2017-01-08 |
| First published | 2016-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/delta-list
- Repository: https://github.com/mafintosh/delta-list
- Issues: https://github.com/mafintosh/delta-list/issues
- npm.io page: https://npm.io/package/delta-list

## Recent versions

- 1.1.0 (latest) — 2017-01-08
- 1.0.1 — 2016-01-25
- 1.0.0 — 2016-01-25

## README

# delta-list

Data structure that maps an integer list to a list of relative integer deltas

```
npm install delta-list
```

[![build status](http://img.shields.io/travis/mafintosh/delta-list.svg?style=flat)](http://travis-ci.org/mafintosh/delta-list)

## Usage

``` js
var delta = require('delta-list')

var deltas = delta.pack([1, 2, 3, 4, 5])
console.log(deltas) // prints [1, 1, 1, 1, 1]

var abs = delta.unpack(deltas)
console.log(abs) // prints [1, 2, 3, 4, 5]
```

## API

#### `array = delta.pack(list, [resultList])`

Map a list of integers to a list of relative deltas.
Optionally you can pass in a list to store the deltas in.

#### `array = delta.unpack(list, [resultList])`

Map a list of relative deltas to a list of integers.
Optionally you can pass in a list to store the integers in.

## When is this useful?

If you have a sorted list of integers and you want to transmit then over a network
it can be useful to only send the deltas and the resulting integers will be smaller
meaning you'll need fewer bytes to encode them.

## License

MIT

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