# compare-at-paths

> create a compare function that compares given paths into an object.

Latest version **1.0.0** (published 2018-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install compare-at-paths
pnpm add compare-at-paths
yarn add compare-at-paths
bun add compare-at-paths
```

## 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.0 |
| Published | 2018-09-20 |
| First published | 2018-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/compare-at-paths
- Repository: https://github.com/dominictarr/compare-at-paths
- Issues: https://github.com/dominictarr/compare-at-paths/issues
- npm.io page: https://npm.io/package/compare-at-paths

## Dependencies (3)

- [tape](https://npm.io/package/tape.md) ^4.9.1
- [libnested](https://npm.io/package/libnested.md) ^1.3.2
- [typewiselite](https://npm.io/package/typewiselite.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2018-09-20

## README

# compare-at-paths

create a compare function that compares given paths into an object.

## example

``` js
[
  {foo: true, bar: {baz: 1}},
  {foo: true, bar: {baz: 3}},
  {foo: true, bar: {baz: 2}},
  {foo: false, bar: {baz: 1}}
].sort(Compare([['bar', 'baz'], ['foo']]))
```
output will be
``` js
[
  {foo: false, bar: {baz: 1}},
  {foo: true, bar: {baz: 1}},
  {foo: true, bar: {baz: 2}},
  {foo: true, bar: {baz: 3}}
]
```

if you want a field to be in decending order, use `{$reverse: [path...]}`

## License

MIT

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