es-arguments
Version:
Get the argument names of any es method
25 lines (17 loc) • 1 kB
Markdown
# ES Arguments
[](https://travis-ci.org/rphansen91/es-arguments)
[](https://codecov.io/gh/rphansen91/es-arguments)
[](https://www.npmjs.com/package/es-arguments)
[](https://www.npmjs.com/package/es-arguments)
## Description
Get the argument names of any es method.
## Usage
`npm install es-arguments`
```js
const getArguments = require('es-arguments')
getArguments(function (arg1, arg2) {}) // ['arg1', 'arg2']
getArguments(function (arg1=1, arg2=2) {}) // ['arg1', 'arg2']
getArguments(function ({ arg1, arg2 }) {}) // ['{ arg1, arg2 }']
getArguments(function (args = { arg1, arg2 }) {}) // ['args']
getArguments((arg1, arg2) => {}) // ['arg1', 'arg2']
```