# between

> generate arbitary strings that sort between two strings

Latest version **0.1.3** (published 2012-12-26) · 0 weekly downloads

## Install

```sh
npm install between
pnpm add between
yarn add between
bun add between
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2012-12-26 |
| First published | 2012-05-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/between
- Repository: https://github.com/dominictarr/between
- Homepage: http://github.com/dominictarr/between
- npm.io page: https://npm.io/package/between

## Recent versions

- 0.1.3 (latest) — 2012-12-26
- 0.1.2 — 2012-12-18
- 0.1.1 — 2012-12-07
- 0.1.0 — 2012-12-07
- 0.0.1 — 2012-08-22
- 0.0.0 — 2012-05-15

## README

# between

generate a string that is between two strings.

## Example

there is an infinite number of numbers between 0 and 1.
0.5, 0.25, 0.00000000000000000000001, etc.

I wrote this module because I needed it for
[crdt](https://github.com/dominictarr/crdt).

I used it to mark the position of items in a sequence.

Say, A, B, C are inserted into positions 1, 2, 3.  
then, insert D inbetween A & B, into position 1.5. then move
C to position 1.25 and B to position 1.125. Now the list is A, B, C, D.

Seems like a funny way to track the position of elements right?

This method has a very important property: it is commutative.
concurrent inserts behave nicely, because inserting between two 
items does not change the positions of nodes later in the list!

## API

### between(a, b)

``` js

var b  = require('between')
var tween = b.between('a', 'b')

//tween is a string that will sort between 'a' and 'b'.


```

`a` and `b` can be any string that does not end in the lowest character.
this is like how there is only one number between 0 and 1 that ends in a "0".

### between.hi, between.lo

the top most string possible, and the lowest string possible. You must not be used
as positions for items, because it will not be possible to insert items after
or before them. These values represent the space infront of the first item, and the space between the last item.

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