# sort-ts

> Sorting algorithms for Typescript

Latest version **0.0.7** (published 2020-04-15) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install sort-ts
pnpm add sort-ts
yarn add sort-ts
bun add sort-ts
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-04-15 |
| First published | 2020-04-13 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 12.14.1 |
| Dependencies | 0 |
| Unpacked size | 50.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | notsag-dev |
| Maintainers | notsag-dev |

## Links

- npm: https://www.npmjs.com/package/sort-ts
- Repository: https://github.com/notsag-dev/sort-ts
- Homepage: https://github.com/notsag-dev/sort-ts#readme
- Issues: https://github.com/notsag-dev/sort-ts/issues
- npm.io page: https://npm.io/package/sort-ts

## Recent versions

- 0.0.7 (latest) — 2020-04-15
- 0.0.6 — 2020-04-14
- 0.0.5 — 2020-04-13
- 0.0.4 — 2020-04-13
- 0.0.3 — 2020-04-13
- 0.0.2 — 2020-04-13
- 0.0.1 — 2020-04-13

## README

# sort-ts
![build](https://github.com/notsag-dev/sort-ts/workflows/build/badge.svg)

Sorting algorithms for Typescript. All of the implemented algorithms are at the moment not-in-place ones, meaning they create and return a new array instead of mutating the original one.

## Install
```
npm install sort-ts
```

## Use
```javascript
import {
  binaryTreeSort,
  bubbleSort,
  insertionSort,
  mergeSort,
  quickSort,
  selectionSort,
  shellSort
} from 'sort-ts';

// Compare function for ascending order
function compare(a: number, b: number): number {
  return a - b;
}

const orderedArray = bubbleSort([-1, 1, -100, 1000, 23, 34, 10000, 0], compare);
// Same for other algorithms
```

## Contribute
Some algorithms could be added to the library. Feel free to add new ones and create a pull request!

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