# ee-arguments

> parses the arguments array passed to a function by variable type and their position in the array, returns the requested type & position

Latest version **1.0.4** (published 2014-04-30) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2014-04-30 |
| First published | 2013-09-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.7 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael van der Weg |
| Maintainers | ee |
| Keywords | function, arguments, parser |

## Links

- npm: https://www.npmjs.com/package/ee-arguments
- Repository: https://github.com/eventEmitter/ee-arguments
- Issues: https://github.com/eventEmitter/ee-arguments/issues
- npm.io page: https://npm.io/package/ee-arguments

## Dependencies (3)

- [ee-log](https://npm.io/package/ee-log.md) 0.2.*
- [ee-class](https://npm.io/package/ee-class.md) 1.0.*
- [ee-types](https://npm.io/package/ee-types.md) 0.1.*

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2014-04-30
- 0.1.5 — 2014-04-30
- 1.0.3 — 2014-04-29
- 1.0.2 — 2014-04-27
- 1.0.1 — 2014-04-27
- 1.0.0 — 2014-04-27
- 0.1.4 — 2014-01-15
- 0.1.1 — 2013-11-25
- 0.1.0 — 2013-09-21

## README

# ee-arguments

parses the arguments array passed to a function by variable type and their position in the array, returns the requested type & position

## installation

	npm install ee-arguments


## build status

[![Build Status](https://travis-ci.org/eventEmitter/ee-argv.png?branch=master)](https://travis-ci.org/eventEmitter/ee-arguments)


## API

### Constructor

Creates an instance of the Arguments class bound to the current arguments object.

	var Arguments = require('ee-arguments');

	var myFunction(){
		var args = new Arguments(arguments);
	};

	myFunction();

### get

Get the first occurence of a specific type from the arguments object, return an optional defined default if the type is not found.


	var myFunction(){
		var args = new Arguments(arguments);

        args.get('string', 'defaultValue'); // do not use strings this way!
        args.get('boolean', true); // true
	};

	myFunction(1, new String('do not use strings this way!'), 'second string');




### getByIndex

Returns the item of the defined type and the defined index from the arguments object. return an optional defined default if the type is not found.


	var myFunction(){
		var args = new Arguments(arguments);

        args.getByIndex('string', 1, function default(){}); // second string
        args.getByIndex('string', 5); // undefined
	};

	myFunction(1, new String('do not use strings this way!'), 'second string');


### Type specif methods

For the types defined below there are specific methods available

- string
- number
- boolean
- array
- object
- function
- date
- regexp
- error
- undefined
- buffer
- null


	var myFunction(){
		var args = new Arguments(arguments);

        args.getString(); // do not use strings this way!
        args.getNumberByIndex(1, 'defaultValue'); // second string
	};

	myFunction(1, new String('do not use strings this way!'), 'second string');



## Verions History

- 1.0.0: complete rewrite, made it easier to user, made it faster. Chnaged the API
- 1.0.1: Added travis.yml

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