# curry-di

> Similar to the standard curry function found in functional programming but allowing parameters to applied non-sequentially based on names matching a supplied object

Latest version **0.9.1** (published 2013-08-30) · 0 weekly downloads

## Install

```sh
npm install curry-di
pnpm add curry-di
yarn add curry-di
bun add curry-di
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.1 |
| Published | 2013-08-30 |
| First published | 2013-08-30 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matthew Forrester |
| Maintainers | forbesmyester |

## Links

- npm: https://www.npmjs.com/package/curry-di
- Repository: https://github.com/forbesmyester/curry-di
- Issues: https://github.com/forbesmyester/curry-di/issues
- npm.io page: https://npm.io/package/curry-di

## Dependencies (1)

- [get-parameter-names](https://npm.io/package/get-parameter-names.md) ~0.1.1

## Recent versions

- 0.9.1 (latest) — 2013-08-30
- 0.9.0 — 2013-08-30

## README

# curry-di

Similar to the standard curry function found in functional programming but allowing parameters to applied non-sequentially based on names matching a supplied object.

The primary purpose of this library is so you can use function parameters to include dependencies of that function and later normalize them into a standard form.

## An Example

##### routes/user.js

	module.exports.register = function(err, req, res, bcrypt, emailSender, db, next) { }
	module.exports.login = function(err, req, res, memcache, db, next) { }
	
##### app.js
    
	var curryDi = require('curry-di');
	var dependencies = {
		emailSender: var emailSender = curry(require('email-sender'))('localhost'),
		bcrypt: require('bcrypt'),
		db: db,
		memcacheApi: memcacheApi
	};
	
	// The return value of curryDi(dependencies, ...) is a function with the
	// signature function(err, req, res, next) as all other parameters have 
	// been matched to the dependences object.
	app.post('/user/register', curryDi(dependencies, userRoute.register));
	app.post('/user/login', curryDi(dependencies, userRoute.login));

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