median

a small module for node and browser to calculate median

npm install median
4 downloads in the last day
17 downloads in the last week
32 downloads in the last month

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

var median = require('median')
var arr = [1, 15, 200, 30]
var value = median(arr)

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

Browser

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

console.log("median value is " + value)
npm loves you