# ndarray-sort

> Sorts ndarrays in place

Latest version **1.0.1** (published 2015-05-14) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2015-05-14 |
| First published | 2013-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko, rreusser, planeshifter, jaspervdg, hughsk, substack |
| Keywords | ndarray, sort, typed, array, int, quicksort |

## Links

- npm: https://www.npmjs.com/package/ndarray-sort
- Repository: https://github.com/mikolalysenko/ndarray-sort
- Issues: https://github.com/mikolalysenko/ndarray-sort/issues
- npm.io page: https://npm.io/package/ndarray-sort

## Dependencies (1)

- [typedarray-pool](https://npm.io/package/typedarray-pool.md) ^1.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-05-14
- 1.0.0 — 2014-06-04
- 0.1.0 — 2014-03-26
- 0.0.0 — 2013-08-01

## README

ndarray-sort
============
Sorts [ndarrays](https://github.com/mikolalysenko/ndarray) in place using a dual pivot quick sort.

## Example

```javascript
var ndarray = require("ndarray")
var ndsort = require("ndarray-sort")
var unpack = require("ndarray-unpack")

//Create an array
var x = ndarray(new Float32Array(60), [20, 3])

for(var i=0; i<20; ++i) {
  for(var j=0; j<3; ++j) {
    x.set(i,j, Math.random())
  }
}

//Print out x:
console.log("Unsorted:", unpack(x))

//Sort x
ndsort(x)

//Print out sorted x:
console.log("Sorted:", unpack(x))
```

## Install

    npm install ndarray-sort

## API

### `require("ndarray-sort")(array)`
Sorts the given array along the first axis in lexicographic order.  The sorting is done in place.

* `array` is an ndarray

**Returns** `array`

## Credits
Based on Google Dart's dual pivot quick sort implementation by Ola Martin Bini and Michael Haubenwallner.  For more information see lib/dart/AUTHORS and lib/dart/LICENSE

JavaScript implementation (c) 2013 Mikola Lysenko.  MIT License

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