# arg-find

> write functions that accept arguments in any order

Latest version **1.0.2** (published 2016-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install arg-find
pnpm add arg-find
yarn add arg-find
bun add arg-find
```

## 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.0.2 |
| Published | 2016-06-01 |
| First published | 2016-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Rhodes |
| Maintainers | michaelrhodes |
| Keywords | arguments, type, find, order |

## Links

- npm: https://www.npmjs.com/package/arg-find
- Repository: https://github.com/michaelrhodes/arg-find
- Issues: https://github.com/michaelrhodes/arg-find/issues
- npm.io page: https://npm.io/package/arg-find

## Dependencies (1)

- [tiny-typeof](https://npm.io/package/tiny-typeof.md) ~1.0.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-06-01
- 1.0.1 — 2016-05-14
- 1.0.0 — 2016-05-14

## README

# arg-find

Write functions that accept arguments in any order (so long as each is of a unique type). It’s weird, yes, but I sometimes find this useful for handling optional parameters.

[![Build status](https://travis-ci.org/michaelrhodes/arg-find.svg?branch=master)](https://travis-ci.org/michaelrhodes/arg-find)

## Install
```sh
$ npm install arg-find
```

### Example

``` js
var find = require('arg-find')

function fn () {
  var arg = find(arguments)
  var opt = arg('object') || {}
  var cb = arg('function')

  opt.throw ?
    cb(new Error) :
    cb(null)
}

fn(function (err) {
  console.log(err)
  > null
})

fn({ throw: true }, function (err) {
  console.log(err instanceof Error)
  > true
})

fn(function (err) {
  console.log(err instanceof Error)
  > true
}, { throw: true })
```

### License
[MIT](http://opensource.org/licenses/MIT)

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