# fn-arg-names

> Get any arguments from any function

Latest version **1.0.0** (published 2021-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install fn-arg-names
pnpm add fn-arg-names
yarn add fn-arg-names
bun add fn-arg-names
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-06-24 |
| First published | 2021-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Unpacked size | 22.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | cotenochek |
| Maintainers | cotenochek |
| Keywords | function, fn-arg-names, fn, arg, args, arguments, arg-names, argument-names |

## Links

- npm: https://www.npmjs.com/package/fn-arg-names
- Repository: https://github.com/StormExecute/fn-arg-names
- Homepage: https://github.com/StormExecute/fn-arg-names/#readme
- Issues: https://github.com/StormExecute/fn-arg-names/issues
- npm.io page: https://npm.io/package/fn-arg-names

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-06-24

## README

# fn-arg-names [![NPM version][npm-image]][npm-url]

Get any arguments from any function.

# Description

This module will help you extract absolutely all valid arguments from functions and pass them to you as an array. 

# Table of Contents

* [Install](#install)
* [Usage](#usage)
* [API](#api)
* [Contacts](#contacts)

<div id='install'></div>

# Install

```bash
$ npm install fn-arg-names
```

<div id='usage'></div>

# Usage

```javascript

const fnArgNames = require("fn-arg-names");

const result = fnArgNames("async function * a({a, b, c: d}, r = function(a,b) { return (a + b) }, {t = {}}, [e, f, [g, h], {i}, [j, {k}, [l, m, n]], ...args], o, /*p,*/ ...q){}");

console.log(result);

const simple = fnArgNames(function(a, b, c = (1 + 2 + 3), ...d) {});

console.log(simple);

```

```bash

[
  [ 'a', 'b', 'c', origin: 'object' ],
  'r',
  [ 't', origin: 'object' ],
  [
    'e',
    'f',
    [ 'g', 'h', origin: 'array' ],
    [ 'i', origin: 'object' ],
    [ 'j', [Array], [Array], origin: 'array' ],
    '...args',
    origin: 'array'
  ],
  'o',
  '...q'
]

[ 'a', 'b', 'c', '...d' ]

```

<div id='api'></div>

# API

Types: [HERE!](https://github.com/StormExecute/fn-arg-names/blob/master/index.d.ts)

### fnArgNames(fn: string | Function) => answer
The main function.

### fnArgNames.default(fn: string | Function) => answer
The same as fnArgNames.

### fnArgNames.strict(fn: string | Function) => answer
The same as fnArgNames, but in case of syntax errors in string function will return a detailed analysis of the error.

### fnArgNames.auto(fn: string | Function) => answer
If a string is passed, it returns the result of fnArgNames.strict, otherwise it returns the result of fnArgNames.default .

<div id='contacts'></div>

# Contacts

**Yandex Mail** - vladimirvsevolodovi@yandex.ru

**Github** - https://github.com/StormExecute/

# Platforms

**Github** - https://github.com/StormExecute/fn-arg-names/

**NPM** - https://www.npmjs.com/package/fn-arg-names/

# License

**MIT** - https://mit-license.org/

[npm-url]: https://www.npmjs.com/package/fn-arg-names
[npm-image]: https://img.shields.io/npm/v/fn-arg-names.svg

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