<commit_before>incrmax
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Provides a method to compute a maximum value incrementally.


## Installation

``` bash
$ npm install compute-incrmax
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).


## Usage


``` javascript
var incrmax = require( 'compute-incrmax' );
```

#### incrmax()

Returns an initialized method to compute a maximum value incrementally.

``` javascript
var max = incrmax();
```

#### max( [value] )

If provided a `value`, the method updates and returns the updated max. If not provided a `value`, the method returns the current max.

``` javascript
max( 2 );

console.log( max( 1 ) );
// returns 2

max( 3 );

console.log( max() );
// returns 3
```

Note: if values have not yet been provided to `max()`, `max()` returns `null`.


## Examples

``` javascript
var incrmax = require( 'compute-incrmax' );

// Initialize a method to calculate the max incrementally:
var max = incrmax();

// Simulate some data...
for ( var i = 0; i < 1000; i++ ) {
	max( Math.random() * 100 );
}

console.log( max() );
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```

## Notes

The use case for this module differs from the conventional [vector](https://github.com/compute-io/max) implementation and the [stream](https://github.com/flow-io/?query=max) implementation. Namely, this module decouples the act of updating the max from the act of consuming the max.


## Tests

### Unit

Unit tests use the [Mocha](http://visionmedia.github.io/mocha) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.


### Test Coverage

This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:<commit_msg>[FIX] mocha link<commit_after>incrmax
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Provides a method to compute a maximum value incrementally.


## Installation

``` bash
$ npm install compute-incrmax
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).


## Usage


``` javascript
var incrmax = require( 'compute-incrmax' );
```

#### incrmax()

Returns an initialized method to compute a maximum value incrementally.

``` javascript
var max = incrmax();
```

#### max( [value] )

If provided a `value`, the method updates and returns the updated max. If not provided a `value`, the method returns the current max.

``` javascript
max( 2 );

console.log( max( 1 ) );
// returns 2

max( 3 );

console.log( max() );
// returns 3
```

Note: if values have not yet been provided to `max()`, `max()` returns `null`.


## Examples

``` javascript
var incrmax = require( 'compute-incrmax' );

// Initialize a method to calculate the max incrementally:
var max = incrmax();

// Simulate some data...
for ( var i = 0; i < 1000; i++ ) {
	max( Math.random() * 100 );
}

console.log( max() );
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```

## Notes

The use case for this module differs from the conventional [vector](https://github.com/compute-io/max) implementation and the [stream](https://github.com/flow-io/?query=max) implementation. Namely, this module decouples the act of updating the max from the act of consuming the max.


## Tests

### Unit

Unit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.


### Test Coverage

This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
{'fraction_non_alphanumeric': 0.1367369589345172, 'fraction_numerical': 0.0057713651498335185, 'mean_word_length': 4.435464414957781, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2289383', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1293, 'n_words': 497}