# object-to-sorted-array

> Sort object by key or value

Latest version **1.0.0** (published 2021-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install object-to-sorted-array
pnpm add object-to-sorted-array
yarn add object-to-sorted-array
bun add object-to-sorted-array
```

## 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 | 2021-11-29 |
| First published | 2021-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Joseph Miller |
| Maintainers | michael-joseph-miller |

## Links

- npm: https://www.npmjs.com/package/object-to-sorted-array
- Repository: https://github.com/michael-joseph-miller/object-to-sorted-array
- Homepage: https://github.com/michael-joseph-miller/object-to-sorted-array#readme
- Issues: https://github.com/michael-joseph-miller/object-to-sorted-array/issues
- npm.io page: https://npm.io/package/object-to-sorted-array

## Recent versions

- 1.0.0 (latest) — 2021-11-29

## README

# object-prototype-sort<!-- omit in toc -->

Sort an object by key or value<!-- omit in toc -->

[Report Bug][bug] | [Request Features][features]

---

## Table of Contents<!-- omit in toc -->

- [Install](#install)
- [Import](#import)
- [Syntax](#syntax)
- [Parameters](#parameters)
- [Return value](#return-value)
- [License](#license)
- [Contact](#contact)

---

## Install

```sh
npm i object-to-sorted-array
```

## Import

```js
import sortObj from 'object-to-sorted-array';
```

## Syntax

```js
sortObj(object);

sortObj(object[, sortBy])

sortObj(object[, sortBy[, sortOrder]])
```

## Parameters

- **object**

  - object to de sorted

- **sortBy** `(optional)`

  - "key" | "value"
  - sort by the objects keys or values

- **order** `(optional)`
  - "ascending" | "descending"
  - sort in ascending or descending order

## Return value

- Returns an array of sorted key/value pair arrays
  - `[['key', 'value'], ...]`

---

<!-- LICENSE -->

## License

Distributed under the MIT License. See `LICENSE` for more information.

---

<!-- CONTACT -->

## Contact

Project Link: <https://github.com/michael-joseph-miller/object-prototype-sort>

<!-- LINKS & IMAGES -->

[bug]: https://github.com/michael-joseph-miller/object-to-sorted-array/issues
[features]: https://github.com/michael-joseph-miller/object-to-sorted-array/issues

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