# exact-order

> Dead simple module for ordering by an explicit order weighing in at ~1.3KB.

Latest version **0.1.1** (published 2017-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install exact-order
pnpm add exact-order
yarn add exact-order
bun add exact-order
```

## 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.1 |
| Published | 2017-04-03 |
| First published | 2017-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Adam Timberlake |
| Maintainers | wildhoney |
| Keywords | ordering, order, exact order, explicit order, specific order, set order |

## Links

- npm: https://www.npmjs.com/package/exact-order
- Repository: https://github.com/Wildhoney/ExactOrder
- Homepage: https://github.com/Wildhoney/ExactOrder#readme
- Issues: https://github.com/Wildhoney/ExactOrder/issues
- npm.io page: https://npm.io/package/exact-order

## Dependencies (1)

- [object-path](https://npm.io/package/object-path.md) ~0.11.4

## Recent versions

- 0.1.1 (latest) — 2017-04-03
- 0.1.0 — 2017-04-03

## README

# Exact Order

> Dead simple module for ordering by an explicit order weighing in at 1.3KB.<br /><br />
> :bulb: Useful for when you have an array of dynamic data, but you need to sort by a set order, rather than a natural sort order, such as alphabetically or numerically.<br /><br />
> `npm i exact-order --save`

![Travis](http://img.shields.io/travis/Wildhoney/ExactOrder.svg?style=flat-square)
&nbsp;
![Coveralls](https://img.shields.io/coveralls/Wildhoney/ExactOrder.svg?style=flat-square)
&nbsp;
![npm](http://img.shields.io/npm/v/exact-order.svg?style=flat-square)
&nbsp;
![License MIT](https://img.shields.io/badge/license-mit-lightgrey.svg?style=flat-square)

## Getting Started

Simply pass in either an array or map of the set order. For sorting on multiple properties you're able to pass in a map with multiple keys &ndash; with the relevance being from top-to-bottom.

```javascript
import as from 'exact-order';

// Primitives.
[1, 2, 3].sort(as([2, 1, 3])); // [2, 1, 3]

// Complex nested.
[{ value: 1 }, { value: 2 }, { value: 3 }].sort(as({
    value: [2, 1, 3]
})); // [{ value: 2 }, { value: 1 }, { value: 3 }]
```

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