https://github.com/winterbe/compary
A library for composing complex compare-functions in JavaScript
https://github.com/winterbe/compary
Last synced: 6 months ago
JSON representation
A library for composing complex compare-functions in JavaScript
- Host: GitHub
- URL: https://github.com/winterbe/compary
- Owner: winterbe
- License: mit
- Created: 2017-09-12T07:36:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-12T08:55:23.000Z (over 8 years ago)
- Last Synced: 2025-06-07T08:42:34.515Z (7 months ago)
- Language: TypeScript
- Homepage: https://winterbe.github.io/compary/
- Size: 154 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compary [](https://travis-ci.org/winterbe/compary)
> A library for composing complex compare-functions.
```js
persons.sort(
compareBy(p => p.lastName)
.thenBy(p => p.firstName)
);
```
---
★★★ Like this project? Leave a star and feedback on Twitter! Thanks. ★★★
---
## Getting started
Download the [latest release](https://github.com/winterbe/compary/releases) from GitHub or install Compary from [NPM](https://www.npmjs.com/package/compary):
```bash
npm install --save compary
```
Alternatively use Compary from [CDN](https://unpkg.com/compary/) by adding this to your HTML:
```html
```
## License
MIT © [Benjamin Winterberg](https://twitter.com/winterbe_)