# comparefunction

> Comparator helper to compare two values of a specific variable type.

Latest version **1.0.3** (published 2016-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install comparefunction
pnpm add comparefunction
yarn add comparefunction
bun add comparefunction
```

## 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.3 |
| Published | 2016-04-21 |
| First published | 2016-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | skinnybrit51 |
| Maintainers | skinnybrit51 |
| Keywords | Compare, Comparator, compareFunction |

## Links

- npm: https://www.npmjs.com/package/comparefunction
- Repository: https://github.com/skinnybrit51/compareFunction
- Homepage: https://github.com/skinnybrit51/compareFunction#readme
- Issues: https://github.com/skinnybrit51/compareFunction/issues
- npm.io page: https://npm.io/package/comparefunction

## Recent versions

- 1.0.3 (latest) — 2016-04-21
- 1.0.2 — 2016-04-21
- 1.0.1 — 2016-04-21
- 1.0.0 — 2016-04-21

## README

# compareFunction

[![Build Status](https://travis-ci.org/skinnybrit51/compareFunction.svg?branch=master)](https://travis-ci.org/skinnybrit51/compareFunction)
[![NPM version](https://badge.fury.io/js/comparefunction.svg)](http://badge.fury.io/js/comparefunction)

#### Description
Comparator helper to compare two values of a specific variable type. Usually used with ```array.sort```

#### Installation

```npm install comparefunction```

#### Using
```
var compareFunction = require('comparefunction');

var dateArray = ['2012-01-01', '2011-01-01', '2013-01-01', '2009-01-01'];
dateArray.sort(compareFunction.date);

console.log(dateArray);
['2009-01-01', '2011-01-01', '2012-01-01', '2013-01-01'];

```

#### Supported Types
- ```compareFunction.string```
- ```compareFunction.boolean```
- ```compareFunction.integer```
- ```compareFunction.float```
- ```compareFunction.date```

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