# @f/reduce

> Reduce over the elements of a container

Latest version **1.0.0** (published 2016-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/reduce
pnpm add @f/reduce
yarn add @f/reduce
bun add @f/reduce
```

## 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.0 |
| Published | 2016-01-10 |
| First published | 2016-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/reduce
- Repository: https://github.com/micro-js/reduce
- Homepage: https://github.com/micro-js/reduce#readme
- Issues: https://github.com/micro-js/reduce/issues
- npm.io page: https://npm.io/package/@f/reduce

## Dependencies (4)

- [@f/is-array](https://npm.io/package/@f/is-array.md) ^1.1.1
- [@f/is-object](https://npm.io/package/@f/is-object.md) ^1.1.1
- [@f/reduce-obj](https://npm.io/package/@f/reduce-obj.md) ^1.0.0
- [@f/reduce-array](https://npm.io/package/@f/reduce-array.md) ^0.2.1

## Recent versions

- 1.0.0 (latest) — 2016-01-10

## README

# reduce

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Reduce over the elements of a container

## Installation

    $ npm install @f/reduce

## Usage

```js
var reduce = require('@f/reduce')
var fruits = {apples: 2, oranges: 3}
var numFruits = reduce(sum, 0, fruits)

function sum (a, b) {
  return a + b
}
```

## API

### reduce(cb, initialValue, collection)

- `cb` - Callback called for each `collection` item with a accumlator value and the current item.

```js
function cb (accumulator, currentItem, key, colllection) {}
```

- `initialValue` - First value for the accumulator
- `arr` Collection to be reduced

**Returns:** The accumulated value

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/reduce.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/reduce
[git-image]: https://img.shields.io/github/tag/micro-js/reduce.svg
[git-url]: https://github.com/micro-js/reduce
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/reduce.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/reduce

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