# vargs

> practical variable argument handling

Latest version **0.1.0** (published 2015-01-01) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-01-01 |
| First published | 2015-01-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.1.93 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexis Sellier |
| Keywords | argument, arguments |

## Links

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

## Recent versions

- 0.1.0 (latest) — 2015-01-01

## README

vargs
=====

> variable argument handling for functions taking a callback

rationale
----------

JavaScript has very poor argument handling. *vargs* tries to make it simpler.

synopsis
--------

    var Args = require("vargs").Constructor;
  
    function (/* [arg1, arg2, ...][,callback] */) {
        var args = new(Args)(arguments);
        
        args.first;    // first argument
        args.last;     // last argument before callback
        args.callback; // callback argument, or an empty function
        args.all;      // all arguments except callback
        args.length;   // number of arguments, not including callback
        
        args.callbackGiven(); // returns true or false
        args.at(-1);          // last argument, including callback
        args.array;           // all arguments, including callback
    }

example
-------

For a real-world example of *vargs*, check <http://github.com/cloudhead/cradle>

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