# chickencurry

> Add some chicken curry to your functions

Latest version **2.2.1** (published 2015-06-22) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.2.1 |
| Published | 2015-06-22 |
| First published | 2014-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 87 |
| Author | stoeffel |
| Maintainers | schtoeffel |
| Keywords | function, curry, functional |

## Links

- npm: https://www.npmjs.com/package/chickencurry
- Repository: https://github.com/stoeffel/chickencurry
- Homepage: http://github.com/stoeffel/chickencurry
- Issues: http://github.com/stoeffel/chickencurry/issues
- npm.io page: https://npm.io/package/chickencurry

## Recent versions

- 2.2.1 (latest) — 2015-06-22
- 2.2.0 — 2015-06-22
- 2.1.1 — 2015-06-22
- 2.1.0 — 2015-06-22
- 1.4.0 — 2015-02-27
- 1.3.0 — 2015-02-26
- 1.2.1 — 2015-02-08
- 1.2.0 — 2015-02-05
- 1.1.1 — 2015-02-03
- 1.1.0 — 2015-01-18
- 1.0.2 — 2015-01-02
- 1.0.1 — 2015-01-02
- 1.0.0 — 2015-01-02
- 0.4.0 — 2015-01-01
- 0.3.0 — 2014-12-31
- … 2 more at https://npm.io/package/chickencurry/versions

## README

:curry: Chickencurry
============
[![Build Status](https://travis-ci.org/stoeffel/chickencurry.svg)](https://travis-ci.org/stoeffel/chickencurry) [![npm version](https://badge.fury.io/js/chickencurry.svg)](http://badge.fury.io/js/chickencurry) [![Coverage Status](https://coveralls.io/repos/stoeffel/chickencurry/badge.svg?branch=master)](https://coveralls.io/r/stoeffel/chickencurry?branch=master)
> Add some chickencurry to your functions

Library to [curry](http://en.wikipedia.org/wiki/Currying) a function.
It supports auto rurrying, currying a number of arguments, placeholders and partial applications.


Installation
------------

`npm install chickencurry`

Usage
-----

### Basic usage

```js
var curry = require('chickencurry');

function add(a, b) {
  return a + b;
}
var add1 = curry(add)(1);

add1(3); // => 4
add1(4); // => 5
```

### curry with function bind syntax `::` (ES2015)

```js
var curry = require('./');

var add1 = function(a, b) {
  return a + b;
}::curry(1);

add1(3); // => 4
add1(4); // => 5

var sub = function(a, b) {
  return a - b;
}::curry();

sub(3)(1); // => 2
```

### Curry n arguments

```js
var curryN = require('chickencurry/N');

function join() {
  return Array.prototype.slice.call(arguments).join(',');
}

curryN(join, 3)(1)(2)(3) // => '1,2,3'
```

### Curry 1,2 or 3 arguments

```js
var curry1 = require('chickencurry/1');
var curry2 = require('chickencurry/2');
var curry3 = require('chickencurry/3');

curry1(join)(1) // => '1'
curry2(join)(1)(2) // => '1,2'
curry3(join)(1)(2)(3) // => '1,2,3'
```

### Partial applications

```js
var curryN = require('chickencurry/N');

function join() {
  return Array.prototype.slice.call(arguments).join(',');
}

curryN(join, 3, 'Fish', 'Chicken')('...'); // => 'Fish,Chicken,...')
curryN(join, 3)('Fish', 'Chicken')('...'); // => 'Fish,Chicken,...')
```

### Placeholder

You can curry a function using placeholders, if you want to set the i.e 3rd argument.

```js
function join(a, b, sep) {
  return a + sep + b;
};

var __ = require('chickencurry/__');

var join_ = curry(join, __, __, '_'); 
// or var join_ = curry(join, undefined, undefined, '_'); 

join_('chicken', 'curry'); // => 'chicken_curry'


var joinCurry = curry(join); 
var joinDash = joinCurry(__, __, '-');

joinDash('chicken', 'curry'); // => 'chicken-curry'
```

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