# naan

> async and flexible currying for js

Latest version **1.3.11** (published 2013-08-15) · 0 weekly downloads

## Install

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

## 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.3.11 |
| Published | 2013-08-15 |
| First published | 2012-05-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Jon Packer |
| Maintainers | jonpacker |

## Links

- npm: https://www.npmjs.com/package/naan
- Repository: https://github.com/jonpacker/naan
- npm.io page: https://npm.io/package/naan

## Dependencies (1)

- [async](https://npm.io/package/async.md) *

## Recent versions

- 1.3.11 (latest) — 2013-08-15
- 1.3.10 — 2012-07-02
- 1.3.9 — 2012-06-14
- 1.3.8 — 2012-06-13
- 1.3.7 — 2012-06-13
- 1.3.6 — 2012-06-07
- 1.3.5 — 2012-06-01
- 1.3.4 — 2012-05-30
- 1.3.3 — 2012-05-30
- 1.3.2 — 2012-05-19
- 1.3.1 — 2012-05-19
- 1.3.0 — 2012-05-19
- 1.2.1 — 2012-05-19
- 1.1.1 — 2012-05-15
- 1.1.0 — 2012-05-15
- … 2 more at https://npm.io/package/naan/versions

## README

# naan.js

Naan.js is a library that provides a set of useful functions for creating
partially applied functions. It was originally created to work with
[node.js](http://nodejs.org) but also works in the browser, so long as you have
also included the [async](https://github.com/caolan/async) module.

The best way to understand what naan does is to see it in action:

## Quick Examples
```javascript

var statFoo = naan.curry(fs.stat, 'foo.txt');
statFoo(function(err, data) {
  // stat result from foo
});

var renameToFoo = naan.positionCurry(fs.rename, fs.rename, 'foo.txt', 1);
renameToFoo('bar.txt', function(err) {
  // 'bar.txt' has been renamed to 'foo.txt'
})

var readFooContents = naan.curry(fs.readFile, 'foo.txt');
var writeFooContents = naan.cook(fs.writeFile, readFooContents, 1);
writeFooContents('bar.txt', function(err) {
  // The contents of 'foo.txt' has been written to 'bar.txt'
})

// Naan works great with Async!
var readers = ['foo.txt', 'bar.txt', 'bob.txt'].map(function(file) {
  return naan.curry(fs.readFile)
});
async.parallel(readers, function(err, contents) {
  // contents == contents of foo.txt, bar.txt & bob.txt
});

```

These are a few of the basic uses of Naan. Each of the available functions are
listed below.

## Download

For node, just use npm:

    npm install naan

## In the Browser

Tested in IE9+. It currently uses some ES5 stuff which doesn't work in IE8, but this will be
fixed shortly.

For info on how to test in the browser, see [testing](#testing).

```html
<script src="async.min.js"></script>
<script src="naan.min.js"></script>
<script>
  var createDiv = naan.curry(document.createElement, 'div');
</script>
```

__Development:__ [naan.js](https://github.com/jonpacker/naan/raw/master/naan.js) - 9.5kb Uncompressed

__Production:__ [naan.min.js](https://github.com/caolan/async/raw/master/naan.min.js) - 3.0kb Minified

## Documentation

### Curries

* [curry](#curry)
* [rightCurry](#rightCurry)
* [curryArgs](#curryArgs)
* [curryArgsRight](#curryArgsRight)
* [positionCurry](#positionCurry)
* [entangleCurry](#entangleCurry)

### Cooking

* [cook](#cook)

### Return control

* [alwaysReturn](#alwaysReturn)

### Group Curries

* [crock](#crock)
* [combine](#combine)

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