# fast-args

> Very fast way to turn a function's `arguments` into an array.

Latest version **1.0.0** (published 2016-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-args
pnpm add fast-args
yarn add fast-args
bun add fast-args
```

## 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.0 |
| Published | 2016-09-08 |
| First published | 2016-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jamen Marz |
| Maintainers | jamen |
| Keywords | fast, variadic, args, arguments, slice, clone |

## Links

- npm: https://www.npmjs.com/package/fast-args
- Repository: https://github.com/jamen/fast-args
- Issues: https://github.com/jamen/fast-args/issues
- npm.io page: https://npm.io/package/fast-args

## 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.0 (latest) — 2016-09-08
- 0.1.3 — 2016-09-08
- 0.1.2 — 2016-09-08

## README

# fast-args [![NPM version](https://badge.fury.io/js/fast-args.svg)](https://npmjs.org/package/fast-args) [![Build Status](https://travis-ci.org/jamen/fast-args.svg?branch=master)](https://travis-ci.org/jamen/fast-args)

> Very fast way to turn a function's `arguments` into an array.

```js
var fargs = require('fast-args');

function foo() {
  return fargs(arguments);
}

foo(1, 2, 3);
// => [1, 2, 3]
```

Most functions don't get called with more than 6 params, so this module uses a switch for manually making an array when `arguments.length` is 1 through 6.  It can fall back on a fast slice for any number of params higher than 6.

**Note:** This module is best for ES5 and below. Use [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) for the fastest method (by far) in ES6+.

## Installation

```sh
$ npm install --save fast-args
```

## API

### `fargs(args, [offset])`
Turn the `arguments` object of a function  into an array.
 - `args` (`arguments`): The `arguments` object of a function.
 - `offset` (`Number`): The index to start on `arguments`.

```js
var fargs = require('fast-args');

function foo() {
  var args = fargs(arguments, 1);
  // ...
}
```

This is the only export of the module.

## Meta

 - `npm test`: Run tests.
 - `npm run bench`: Run benchmarks.

## License

MIT © [Jamen Marz](https://github.com/jamen)

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