# arguments-verify

> arguments verifier

Latest version **0.4.2** (published 2017-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install arguments-verify
pnpm add arguments-verify
yarn add arguments-verify
bun add arguments-verify
```

## 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.4.2 |
| Published | 2017-06-05 |
| First published | 2016-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Xavier Garcia Buils |
| Maintainers | xgbuils |
| Keywords | verify, validate, arguments, function |

## Links

- npm: https://www.npmjs.com/package/arguments-verify
- Repository: https://github.com/xgbuils/arguments-verify
- Homepage: https://github.com/xgbuils/arguments-verify#readme
- Issues: https://github.com/xgbuils/arguments-verify/issues
- npm.io page: https://npm.io/package/arguments-verify

## Dependencies (1)

- [type-verify](https://npm.io/package/type-verify.md) ^0.4.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.4.2 (latest) — 2017-06-05
- 0.4.1 — 2017-06-05
- 0.4.0 — 2017-06-05
- 0.3.0 — 2017-03-09
- 0.2.0 — 2016-05-29
- 0.1.0 — 2016-05-28

## README

# arguments-verify
function to check if arguments of function are valid

### Version
0.3.0

### Install
```
npm install --save arguments-verify
```

### Usage
``` javascript
var argumentsVerify = require('arguments-verify')

function func (arr, num) {
    argumentsVerify([['Array'], ['Number', 'Undefined']], function (err) {
        if (err) {
            throw Error('in ' + fnName + ': ' + err.value + ' is not correct')
        }
    }, 'func')
    num = num || 1
    return arr.map(function (e) {
        return e * num
    })
}

// or

var func_validator = {
    fnName: 'func',
    validate: argumentsVerify
}

function func (arr, num) {
    func_validator.validate([['Array'], ['Number', 'Undefined']], function (err) {
        if (err) {
            throw Error('in ' + fnName + ': ' + err.value + ' is not correct')
        }
    })
    num = num || 1
    return arr.map(function (e) {
        return e * num
    })
}
```

### Documentation:
See tests


### LICENSE
MIT

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