# deus

> functional arguments

Latest version **0.3.5** (published 2014-05-17) · MIT license · 0 weekly downloads

## Install

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

## 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.3.5 |
| Published | 2014-05-17 |
| First published | 2014-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Olivier Wietrich |
| Maintainers | bredele |
| Keywords | functional, args, arguments |

## Links

- npm: https://www.npmjs.com/package/deus
- Repository: https://github.com/bredele/deus
- Issues: https://github.com/bredele/deus/issues
- npm.io page: https://npm.io/package/deus

## Dependencies (1)

- [indexof](https://npm.io/package/indexof.md) 0.0.1

## Recent versions

- 0.3.5 (latest) — 2014-05-17
- 0.3.3 — 2014-04-24
- 0.3.2 — 2014-04-24
- 0.3.1 — 2014-04-24
- 0.3.0 — 2014-04-24
- 0.2.0 — 2014-04-19
- 0.0.0 — 2014-04-19

## README

deus
====
 
  > arguments convention over configuration

  A little bit of functional programming to have a single function implementation whatever the arguments exists or their order.

	
## Installation

with [component](http://github.com/component/component):

	$ component install bredele/deus

with [nodejs](http://nodejs.org):

	$ npm install deus


## Usage

  It's a bit complicated to explain with words, so hopefully the example below speaks for itself.

create a function with deus:

```js
// specify the arguments types (have to be different)
var init = deus('string', 'object', function(name, data) {
	console.log('name:', name);
	console.log('data:', data.github);
});
```

deus preserves the arguments:

```js
init('olivier', { github : 'bredele'});
// => name: olivier
// => data: bredele
```

deus doesn't care if an argument is missing:

```js
init({ github : 'bredele'});
// => name: undefined
// => data: bredele
```

deus allows you to switch the arguments order:

```js
init({ github : 'bredele'}, 'olivier');
// => name: olivier
// => data: bredele
```

deus preseves the other arguments:

```js
var other = deus('function', 'object', function(name, data, other) {
	console.log('other:', other);
});
other({
	github: 'bredele'
}, 'olivier');
// => olivier
```

  Deus decreases the number of decisions the developer needs to make because the implementation is the same whatever the arguments are. The returned function is flexible and yet simple.

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