# name-parameters

> make a function accept an options object

Latest version **0.0.2** (published 2017-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install name-parameters
pnpm add name-parameters
yarn add name-parameters
bun add name-parameters
```

## 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.0.2 |
| Published | 2017-04-12 |
| First published | 2017-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | rogerbf |
| Maintainers | rogerbf |
| Keywords | options, function, named parameters, parameters, named arguments, params, name params |

## Links

- npm: https://www.npmjs.com/package/name-parameters
- npm.io page: https://npm.io/package/name-parameters

## Dependencies (1)

- [babylon](https://npm.io/package/babylon.md) ^6.16.1

## Recent versions

- 0.0.2 (latest) — 2017-04-12
- 0.0.1 — 2017-04-04

## README

# name-parameters

Wrap a function that expects any number of parameters in a new function that expects an options object instead.

## usage

```javascript
const nameParameters = require(`name-parameters`)

const tell = (who, what) => console.log(`${who}: ${what}`)

const notify = nameParameters(tell)
// alternative: nameParameters(tell, [ `who`, `what` ])

notify({ who: `Crew`, what: `Engage` })
// Crew: Engage
```

## api

### `nameParameters(fn[, parameterNames])`

- `fn` function to wrap.

- `parameterNames` <Array> manually name parameters, in order.

Returns a function.

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