Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lafikl/median

A small module for node and browser to calculate median.
https://github.com/lafikl/median

Last synced: about 1 month ago
JSON representation

A small module for node and browser to calculate median.

Awesome Lists containing this project

README

        

Median
=========

A small module for node and browser to calculate median.

## Install
**NPM**
```
$ npm install median
```

or you can download the repo and use `median.js`

## Usage

**Node.js**
```js
var median = require('median')
var arr = [1, 15, 200, 30]
var value = median(arr)

console.log("median value is " + value)
```

**Browser**
```js
var arr = [1, 15, 200, 30]
var value = window.median(arr)

console.log("median value is " + value)
```